diff --git a/NadekoBot/Classes/ServerSpecificConfig.cs b/NadekoBot/Classes/ServerSpecificConfig.cs index 15da9d4b..f71e7671 100644 --- a/NadekoBot/Classes/ServerSpecificConfig.cs +++ b/NadekoBot/Classes/ServerSpecificConfig.cs @@ -10,7 +10,7 @@ using Newtonsoft.Json; namespace NadekoBot.Classes { internal class SpecificConfigurations { public static SpecificConfigurations Default { get; } = new SpecificConfigurations(); - public static bool Instantiated { get; set; } = false; + public static bool Instantiated { get; private set; } private const string filePath = "data/ServerSpecificConfigs.json"; diff --git a/NadekoBot/Classes/Trivia/TriviaGame.cs b/NadekoBot/Classes/Trivia/TriviaGame.cs index 613a2af2..c3245cd3 100644 --- a/NadekoBot/Classes/Trivia/TriviaGame.cs +++ b/NadekoBot/Classes/Trivia/TriviaGame.cs @@ -96,6 +96,7 @@ namespace NadekoBot.Classes.Trivia { try { if (e.Channel.IsPrivate) return; if (e.Server != server) return; + if (e.User.Id == NadekoBot.Client.CurrentUser.Id) return; var guess = false; lock (_guessLock) { diff --git a/NadekoBot/Commands/CopyCommand.cs b/NadekoBot/Commands/CopyCommand.cs index c4ea88cd..6c9b0225 100644 --- a/NadekoBot/Commands/CopyCommand.cs +++ b/NadekoBot/Commands/CopyCommand.cs @@ -13,6 +13,7 @@ namespace NadekoBot.Commands { } private async void Client_MessageReceived(object sender, Discord.MessageEventArgs e) { + if (e.User.Id == NadekoBot.Client.CurrentUser.Id) return; try { if (string.IsNullOrWhiteSpace(e.Message.Text)) return; diff --git a/NadekoBot/Commands/CrossServerTextChannel.cs b/NadekoBot/Commands/CrossServerTextChannel.cs index 1b6545e8..4def85f9 100644 --- a/NadekoBot/Commands/CrossServerTextChannel.cs +++ b/NadekoBot/Commands/CrossServerTextChannel.cs @@ -12,7 +12,7 @@ namespace NadekoBot.Commands { public CrossServerTextChannel(DiscordModule module) : base(module) { NadekoBot.Client.MessageReceived += async (s, e) => { try { - if (e.Message.User.Id == NadekoBot.Creds.BotId) return; + if (e.User.Id == NadekoBot.Client.CurrentUser.Id) return; foreach (var subscriber in Subscribers) { var set = subscriber.Value; if (!set.Contains(e.Channel)) @@ -25,7 +25,7 @@ namespace NadekoBot.Commands { }; NadekoBot.Client.MessageUpdated += async (s, e) => { try { - if (e.After?.User?.Id == null || e.After.User.Id == NadekoBot.Creds.BotId) return; + if (e.After?.User?.Id == null || e.After.User.Id == NadekoBot.Client.CurrentUser.Id) return; foreach (var subscriber in Subscribers) { var set = subscriber.Value; if (!set.Contains(e.Channel)) diff --git a/NadekoBot/Commands/FilterInvitesCommand.cs b/NadekoBot/Commands/FilterInvitesCommand.cs index 886cfd07..fbcb4910 100644 --- a/NadekoBot/Commands/FilterInvitesCommand.cs +++ b/NadekoBot/Commands/FilterInvitesCommand.cs @@ -18,7 +18,7 @@ namespace NadekoBot.Commands { public FilterInvitesCommand(DiscordModule module) : base(module) { NadekoBot.Client.MessageReceived += async (sender, args) => { - if (args.Channel.IsPrivate) return; + if (args.Channel.IsPrivate || args.User.Id == NadekoBot.Client.CurrentUser.Id) return; try { ServerPermissions serverPerms; if (!IsChannelOrServerFiltering(args.Channel, out serverPerms)) return; diff --git a/NadekoBot/Commands/FilterWordsCommand.cs b/NadekoBot/Commands/FilterWordsCommand.cs index ba029138..c66e483f 100644 --- a/NadekoBot/Commands/FilterWordsCommand.cs +++ b/NadekoBot/Commands/FilterWordsCommand.cs @@ -15,7 +15,7 @@ namespace NadekoBot.Commands { internal class FilterWords : DiscordCommand { public FilterWords(DiscordModule module) : base(module) { NadekoBot.Client.MessageReceived += async (sender, args) => { - if (args.Channel.IsPrivate) return; + if (args.Channel.IsPrivate || args.User.Id == NadekoBot.Client.CurrentUser.Id) return; try { ServerPermissions serverPerms; if (!IsChannelOrServerFiltering(args.Channel, out serverPerms)) return; diff --git a/NadekoBot/Commands/LogCommand.cs b/NadekoBot/Commands/LogCommand.cs index cc470c66..ad902786 100644 --- a/NadekoBot/Commands/LogCommand.cs +++ b/NadekoBot/Commands/LogCommand.cs @@ -25,7 +25,7 @@ namespace NadekoBot.Commands { NadekoBot.Client.MessageReceived += async (s, e) => { - if (e.Channel.IsPrivate) + if (e.Channel.IsPrivate || e.User.Id == NadekoBot.Client.CurrentUser.Id) return; if (!SpecificConfigurations.Default.Of(e.Server.Id).SendPrivateMessageOnMention) return; try { diff --git a/NadekoBot/Commands/RatelimitCommand.cs b/NadekoBot/Commands/RatelimitCommand.cs index a24a8332..133878f1 100644 --- a/NadekoBot/Commands/RatelimitCommand.cs +++ b/NadekoBot/Commands/RatelimitCommand.cs @@ -13,7 +13,7 @@ namespace NadekoBot.Commands { public RatelimitCommand(DiscordModule module) : base(module) { NadekoBot.Client.MessageReceived += async (s, e) => { - if (e.Channel.IsPrivate) + if (e.Channel.IsPrivate || e.User.Id == NadekoBot.Client.CurrentUser.Id) return; ConcurrentDictionary userTimePair; if (!RatelimitingChannels.TryGetValue(e.Channel.Id, out userTimePair)) return; diff --git a/NadekoBot/Commands/SpeedTyping.cs b/NadekoBot/Commands/SpeedTyping.cs index ff64436a..a456c2fd 100644 --- a/NadekoBot/Commands/SpeedTyping.cs +++ b/NadekoBot/Commands/SpeedTyping.cs @@ -88,7 +88,7 @@ namespace NadekoBot.Commands { private async void AnswerReceived(object sender, MessageEventArgs e) { try { - if (e.Channel == null || e.Channel.Id != channel.Id) return; + if (e.Channel == null || e.Channel.Id != channel.Id || e.User.Id == NadekoBot.Client.CurrentUser.Id) return; var guess = e.Message.RawText;