Apply DM Disable attribute to some commands
This commit is contained in:
parent
1e98b44cb7
commit
de408dbfd9
9 changed files with 18 additions and 0 deletions
|
@ -7,6 +7,7 @@ using Discord.Commands;
|
||||||
using Discord.WebSocket;
|
using Discord.WebSocket;
|
||||||
using Geekbot.net.Database;
|
using Geekbot.net.Database;
|
||||||
using Geekbot.net.Database.Models;
|
using Geekbot.net.Database.Models;
|
||||||
|
using Geekbot.net.Lib.CommandPreconditions;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
using Geekbot.net.Lib.Extensions;
|
using Geekbot.net.Lib.Extensions;
|
||||||
using Geekbot.net.Lib.Localization;
|
using Geekbot.net.Lib.Localization;
|
||||||
|
@ -15,6 +16,7 @@ namespace Geekbot.net.Commands.Admin
|
||||||
{
|
{
|
||||||
[Group("admin")]
|
[Group("admin")]
|
||||||
[RequireUserPermission(GuildPermission.Administrator)]
|
[RequireUserPermission(GuildPermission.Administrator)]
|
||||||
|
[DisableInDirectMessage]
|
||||||
public class Admin : ModuleBase
|
public class Admin : ModuleBase
|
||||||
{
|
{
|
||||||
private readonly DiscordSocketClient _client;
|
private readonly DiscordSocketClient _client;
|
||||||
|
|
|
@ -4,6 +4,7 @@ using System.Threading.Tasks;
|
||||||
using Discord;
|
using Discord;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
using Discord.WebSocket;
|
using Discord.WebSocket;
|
||||||
|
using Geekbot.net.Lib.CommandPreconditions;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
using Geekbot.net.Lib.UserRepository;
|
using Geekbot.net.Lib.UserRepository;
|
||||||
|
|
||||||
|
@ -13,6 +14,7 @@ namespace Geekbot.net.Commands.Admin
|
||||||
[RequireUserPermission(GuildPermission.KickMembers)]
|
[RequireUserPermission(GuildPermission.KickMembers)]
|
||||||
[RequireUserPermission(GuildPermission.ManageMessages)]
|
[RequireUserPermission(GuildPermission.ManageMessages)]
|
||||||
[RequireUserPermission(GuildPermission.ManageRoles)]
|
[RequireUserPermission(GuildPermission.ManageRoles)]
|
||||||
|
[DisableInDirectMessage]
|
||||||
public class Mod : ModuleBase
|
public class Mod : ModuleBase
|
||||||
{
|
{
|
||||||
private readonly DiscordSocketClient _client;
|
private readonly DiscordSocketClient _client;
|
||||||
|
|
|
@ -7,6 +7,7 @@ using Discord.Commands;
|
||||||
using Discord.Net;
|
using Discord.Net;
|
||||||
using Geekbot.net.Database;
|
using Geekbot.net.Database;
|
||||||
using Geekbot.net.Database.Models;
|
using Geekbot.net.Database.Models;
|
||||||
|
using Geekbot.net.Lib.CommandPreconditions;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
using Geekbot.net.Lib.Extensions;
|
using Geekbot.net.Lib.Extensions;
|
||||||
using Geekbot.net.Lib.ReactionListener;
|
using Geekbot.net.Lib.ReactionListener;
|
||||||
|
@ -14,6 +15,7 @@ using Geekbot.net.Lib.ReactionListener;
|
||||||
namespace Geekbot.net.Commands.Admin
|
namespace Geekbot.net.Commands.Admin
|
||||||
{
|
{
|
||||||
[Group("role")]
|
[Group("role")]
|
||||||
|
[DisableInDirectMessage]
|
||||||
public class Role : ModuleBase
|
public class Role : ModuleBase
|
||||||
{
|
{
|
||||||
private readonly DatabaseContext _database;
|
private readonly DatabaseContext _database;
|
||||||
|
|
|
@ -4,6 +4,7 @@ using System.Threading.Tasks;
|
||||||
using Discord;
|
using Discord;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
using Geekbot.net.Database;
|
using Geekbot.net.Database;
|
||||||
|
using Geekbot.net.Lib.CommandPreconditions;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
using Geekbot.net.Lib.Extensions;
|
using Geekbot.net.Lib.Extensions;
|
||||||
using Geekbot.net.Lib.Levels;
|
using Geekbot.net.Lib.Levels;
|
||||||
|
@ -25,6 +26,7 @@ namespace Geekbot.net.Commands.User
|
||||||
|
|
||||||
[Command("serverstats", RunMode = RunMode.Async)]
|
[Command("serverstats", RunMode = RunMode.Async)]
|
||||||
[Summary("Show some info about the bot.")]
|
[Summary("Show some info about the bot.")]
|
||||||
|
[DisableInDirectMessage]
|
||||||
public async Task GetInfo()
|
public async Task GetInfo()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
@ -5,12 +5,14 @@ using Discord;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
using Geekbot.net.Database;
|
using Geekbot.net.Database;
|
||||||
using Geekbot.net.Database.Models;
|
using Geekbot.net.Database.Models;
|
||||||
|
using Geekbot.net.Lib.CommandPreconditions;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
using Geekbot.net.Lib.Extensions;
|
using Geekbot.net.Lib.Extensions;
|
||||||
using Geekbot.net.Lib.Localization;
|
using Geekbot.net.Lib.Localization;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands.User
|
namespace Geekbot.net.Commands.User
|
||||||
{
|
{
|
||||||
|
[DisableInDirectMessage]
|
||||||
public class Karma : ModuleBase
|
public class Karma : ModuleBase
|
||||||
{
|
{
|
||||||
private readonly IErrorHandler _errorHandler;
|
private readonly IErrorHandler _errorHandler;
|
||||||
|
|
|
@ -5,6 +5,7 @@ using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
using Geekbot.net.Database;
|
using Geekbot.net.Database;
|
||||||
|
using Geekbot.net.Lib.CommandPreconditions;
|
||||||
using Geekbot.net.Lib.Converters;
|
using Geekbot.net.Lib.Converters;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
using Geekbot.net.Lib.Extensions;
|
using Geekbot.net.Lib.Extensions;
|
||||||
|
@ -33,6 +34,7 @@ namespace Geekbot.net.Commands.User.Ranking
|
||||||
|
|
||||||
[Command("rank", RunMode = RunMode.Async)]
|
[Command("rank", RunMode = RunMode.Async)]
|
||||||
[Summary("get user top 10 in messages or karma")]
|
[Summary("get user top 10 in messages or karma")]
|
||||||
|
[DisableInDirectMessage]
|
||||||
public async Task RankCmd([Summary("type")] string typeUnformated = "messages", [Summary("amount")] int amount = 10)
|
public async Task RankCmd([Summary("type")] string typeUnformated = "messages", [Summary("amount")] int amount = 10)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
@ -5,6 +5,7 @@ using Discord;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
using Geekbot.net.Database;
|
using Geekbot.net.Database;
|
||||||
using Geekbot.net.Lib.AlmostRedis;
|
using Geekbot.net.Lib.AlmostRedis;
|
||||||
|
using Geekbot.net.Lib.CommandPreconditions;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
using Geekbot.net.Lib.Extensions;
|
using Geekbot.net.Lib.Extensions;
|
||||||
using Geekbot.net.Lib.Levels;
|
using Geekbot.net.Lib.Levels;
|
||||||
|
@ -28,6 +29,7 @@ namespace Geekbot.net.Commands.User
|
||||||
|
|
||||||
[Command("stats", RunMode = RunMode.Async)]
|
[Command("stats", RunMode = RunMode.Async)]
|
||||||
[Summary("Get information about this user")]
|
[Summary("Get information about this user")]
|
||||||
|
[DisableInDirectMessage]
|
||||||
public async Task User([Summary("@someone")] IUser user = null)
|
public async Task User([Summary("@someone")] IUser user = null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
@ -7,6 +7,7 @@ using Discord;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
using Geekbot.net.Database;
|
using Geekbot.net.Database;
|
||||||
using Geekbot.net.Database.Models;
|
using Geekbot.net.Database.Models;
|
||||||
|
using Geekbot.net.Lib.CommandPreconditions;
|
||||||
using Geekbot.net.Lib.Converters;
|
using Geekbot.net.Lib.Converters;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
using Geekbot.net.Lib.Extensions;
|
using Geekbot.net.Lib.Extensions;
|
||||||
|
@ -15,6 +16,7 @@ using Geekbot.net.Lib.UserRepository;
|
||||||
namespace Geekbot.net.Commands.Utils
|
namespace Geekbot.net.Commands.Utils
|
||||||
{
|
{
|
||||||
[Group("poll")]
|
[Group("poll")]
|
||||||
|
[DisableInDirectMessage]
|
||||||
public class Poll : ModuleBase
|
public class Poll : ModuleBase
|
||||||
{
|
{
|
||||||
private readonly IEmojiConverter _emojiConverter;
|
private readonly IEmojiConverter _emojiConverter;
|
||||||
|
|
|
@ -5,6 +5,7 @@ using Discord;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
using Geekbot.net.Database;
|
using Geekbot.net.Database;
|
||||||
using Geekbot.net.Database.Models;
|
using Geekbot.net.Database.Models;
|
||||||
|
using Geekbot.net.Lib.CommandPreconditions;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
using Geekbot.net.Lib.Extensions;
|
using Geekbot.net.Lib.Extensions;
|
||||||
using Geekbot.net.Lib.Polyfills;
|
using Geekbot.net.Lib.Polyfills;
|
||||||
|
@ -12,6 +13,7 @@ using Geekbot.net.Lib.Polyfills;
|
||||||
namespace Geekbot.net.Commands.Utils.Quote
|
namespace Geekbot.net.Commands.Utils.Quote
|
||||||
{
|
{
|
||||||
[Group("quote")]
|
[Group("quote")]
|
||||||
|
[DisableInDirectMessage]
|
||||||
public class Quote : ModuleBase
|
public class Quote : ModuleBase
|
||||||
{
|
{
|
||||||
private readonly IErrorHandler _errorHandler;
|
private readonly IErrorHandler _errorHandler;
|
||||||
|
|
Loading…
Reference in a new issue