From de408dbfd999c11c5daadc85df708a32f60ddb22 Mon Sep 17 00:00:00 2001 From: Runebaas Date: Sun, 17 Mar 2019 18:33:18 +0100 Subject: [PATCH] Apply DM Disable attribute to some commands --- Geekbot.net/Commands/Admin/Admin.cs | 2 ++ Geekbot.net/Commands/Admin/Mod.cs | 2 ++ Geekbot.net/Commands/Admin/Role.cs | 2 ++ Geekbot.net/Commands/User/GuildInfo.cs | 2 ++ Geekbot.net/Commands/User/Karma.cs | 2 ++ Geekbot.net/Commands/User/Ranking/Rank.cs | 2 ++ Geekbot.net/Commands/User/Stats.cs | 2 ++ Geekbot.net/Commands/Utils/Poll.cs | 2 ++ Geekbot.net/Commands/Utils/Quote/Quote.cs | 2 ++ 9 files changed, 18 insertions(+) diff --git a/Geekbot.net/Commands/Admin/Admin.cs b/Geekbot.net/Commands/Admin/Admin.cs index fd7bbc6..f60e5df 100644 --- a/Geekbot.net/Commands/Admin/Admin.cs +++ b/Geekbot.net/Commands/Admin/Admin.cs @@ -7,6 +7,7 @@ using Discord.Commands; using Discord.WebSocket; using Geekbot.net.Database; using Geekbot.net.Database.Models; +using Geekbot.net.Lib.CommandPreconditions; using Geekbot.net.Lib.ErrorHandling; using Geekbot.net.Lib.Extensions; using Geekbot.net.Lib.Localization; @@ -15,6 +16,7 @@ namespace Geekbot.net.Commands.Admin { [Group("admin")] [RequireUserPermission(GuildPermission.Administrator)] + [DisableInDirectMessage] public class Admin : ModuleBase { private readonly DiscordSocketClient _client; diff --git a/Geekbot.net/Commands/Admin/Mod.cs b/Geekbot.net/Commands/Admin/Mod.cs index e1653e9..6c6be5a 100644 --- a/Geekbot.net/Commands/Admin/Mod.cs +++ b/Geekbot.net/Commands/Admin/Mod.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using Discord; using Discord.Commands; using Discord.WebSocket; +using Geekbot.net.Lib.CommandPreconditions; using Geekbot.net.Lib.ErrorHandling; using Geekbot.net.Lib.UserRepository; @@ -13,6 +14,7 @@ namespace Geekbot.net.Commands.Admin [RequireUserPermission(GuildPermission.KickMembers)] [RequireUserPermission(GuildPermission.ManageMessages)] [RequireUserPermission(GuildPermission.ManageRoles)] + [DisableInDirectMessage] public class Mod : ModuleBase { private readonly DiscordSocketClient _client; diff --git a/Geekbot.net/Commands/Admin/Role.cs b/Geekbot.net/Commands/Admin/Role.cs index a76c9d5..aa767d1 100644 --- a/Geekbot.net/Commands/Admin/Role.cs +++ b/Geekbot.net/Commands/Admin/Role.cs @@ -7,6 +7,7 @@ using Discord.Commands; using Discord.Net; using Geekbot.net.Database; using Geekbot.net.Database.Models; +using Geekbot.net.Lib.CommandPreconditions; using Geekbot.net.Lib.ErrorHandling; using Geekbot.net.Lib.Extensions; using Geekbot.net.Lib.ReactionListener; @@ -14,6 +15,7 @@ using Geekbot.net.Lib.ReactionListener; namespace Geekbot.net.Commands.Admin { [Group("role")] + [DisableInDirectMessage] public class Role : ModuleBase { private readonly DatabaseContext _database; diff --git a/Geekbot.net/Commands/User/GuildInfo.cs b/Geekbot.net/Commands/User/GuildInfo.cs index 342f80f..6c8b941 100644 --- a/Geekbot.net/Commands/User/GuildInfo.cs +++ b/Geekbot.net/Commands/User/GuildInfo.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using Discord; using Discord.Commands; using Geekbot.net.Database; +using Geekbot.net.Lib.CommandPreconditions; using Geekbot.net.Lib.ErrorHandling; using Geekbot.net.Lib.Extensions; using Geekbot.net.Lib.Levels; @@ -25,6 +26,7 @@ namespace Geekbot.net.Commands.User [Command("serverstats", RunMode = RunMode.Async)] [Summary("Show some info about the bot.")] + [DisableInDirectMessage] public async Task GetInfo() { try diff --git a/Geekbot.net/Commands/User/Karma.cs b/Geekbot.net/Commands/User/Karma.cs index 39b05be..e2a4739 100644 --- a/Geekbot.net/Commands/User/Karma.cs +++ b/Geekbot.net/Commands/User/Karma.cs @@ -5,12 +5,14 @@ using Discord; using Discord.Commands; using Geekbot.net.Database; using Geekbot.net.Database.Models; +using Geekbot.net.Lib.CommandPreconditions; using Geekbot.net.Lib.ErrorHandling; using Geekbot.net.Lib.Extensions; using Geekbot.net.Lib.Localization; namespace Geekbot.net.Commands.User { + [DisableInDirectMessage] public class Karma : ModuleBase { private readonly IErrorHandler _errorHandler; diff --git a/Geekbot.net/Commands/User/Ranking/Rank.cs b/Geekbot.net/Commands/User/Ranking/Rank.cs index 9c37a4a..9a08d98 100644 --- a/Geekbot.net/Commands/User/Ranking/Rank.cs +++ b/Geekbot.net/Commands/User/Ranking/Rank.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using Discord.Commands; using Geekbot.net.Database; +using Geekbot.net.Lib.CommandPreconditions; using Geekbot.net.Lib.Converters; using Geekbot.net.Lib.ErrorHandling; using Geekbot.net.Lib.Extensions; @@ -33,6 +34,7 @@ namespace Geekbot.net.Commands.User.Ranking [Command("rank", RunMode = RunMode.Async)] [Summary("get user top 10 in messages or karma")] + [DisableInDirectMessage] public async Task RankCmd([Summary("type")] string typeUnformated = "messages", [Summary("amount")] int amount = 10) { try diff --git a/Geekbot.net/Commands/User/Stats.cs b/Geekbot.net/Commands/User/Stats.cs index a230456..4145d03 100644 --- a/Geekbot.net/Commands/User/Stats.cs +++ b/Geekbot.net/Commands/User/Stats.cs @@ -5,6 +5,7 @@ using Discord; using Discord.Commands; using Geekbot.net.Database; using Geekbot.net.Lib.AlmostRedis; +using Geekbot.net.Lib.CommandPreconditions; using Geekbot.net.Lib.ErrorHandling; using Geekbot.net.Lib.Extensions; using Geekbot.net.Lib.Levels; @@ -28,6 +29,7 @@ namespace Geekbot.net.Commands.User [Command("stats", RunMode = RunMode.Async)] [Summary("Get information about this user")] + [DisableInDirectMessage] public async Task User([Summary("@someone")] IUser user = null) { try diff --git a/Geekbot.net/Commands/Utils/Poll.cs b/Geekbot.net/Commands/Utils/Poll.cs index 598e78c..617d6e2 100644 --- a/Geekbot.net/Commands/Utils/Poll.cs +++ b/Geekbot.net/Commands/Utils/Poll.cs @@ -7,6 +7,7 @@ using Discord; using Discord.Commands; using Geekbot.net.Database; using Geekbot.net.Database.Models; +using Geekbot.net.Lib.CommandPreconditions; using Geekbot.net.Lib.Converters; using Geekbot.net.Lib.ErrorHandling; using Geekbot.net.Lib.Extensions; @@ -15,6 +16,7 @@ using Geekbot.net.Lib.UserRepository; namespace Geekbot.net.Commands.Utils { [Group("poll")] + [DisableInDirectMessage] public class Poll : ModuleBase { private readonly IEmojiConverter _emojiConverter; diff --git a/Geekbot.net/Commands/Utils/Quote/Quote.cs b/Geekbot.net/Commands/Utils/Quote/Quote.cs index 9a1d072..e2456e7 100644 --- a/Geekbot.net/Commands/Utils/Quote/Quote.cs +++ b/Geekbot.net/Commands/Utils/Quote/Quote.cs @@ -5,6 +5,7 @@ using Discord; using Discord.Commands; using Geekbot.net.Database; using Geekbot.net.Database.Models; +using Geekbot.net.Lib.CommandPreconditions; using Geekbot.net.Lib.ErrorHandling; using Geekbot.net.Lib.Extensions; using Geekbot.net.Lib.Polyfills; @@ -12,6 +13,7 @@ using Geekbot.net.Lib.Polyfills; namespace Geekbot.net.Commands.Utils.Quote { [Group("quote")] + [DisableInDirectMessage] public class Quote : ModuleBase { private readonly IErrorHandler _errorHandler;