Ignore bot DMs

This commit is contained in:
Noikoio 2017-11-17 17:45:00 -08:00
parent 06c94e370a
commit 72c9415da9
2 changed files with 3 additions and 1 deletions

View file

@ -23,6 +23,7 @@ namespace Noikoio.RegexBot.Module.DMLogger
private async Task Client_MessageReceived(SocketMessage arg) private async Task Client_MessageReceived(SocketMessage arg)
{ {
if (!(arg.Channel is IDMChannel)) return; if (!(arg.Channel is IDMChannel)) return;
if (arg.Author.IsBot) return;
await ProcessMessage(arg, false); await ProcessMessage(arg, false);
} }
@ -30,6 +31,7 @@ namespace Noikoio.RegexBot.Module.DMLogger
private async Task Client_MessageUpdated(Cacheable<IMessage, ulong> arg1, SocketMessage arg2, ISocketMessageChannel arg3) private async Task Client_MessageUpdated(Cacheable<IMessage, ulong> arg1, SocketMessage arg2, ISocketMessageChannel arg3)
{ {
if (!(arg2.Channel is IDMChannel)) return; if (!(arg2.Channel is IDMChannel)) return;
if (arg2.Author.IsBot) return;
await ProcessMessage(arg2, true); await ProcessMessage(arg2, true);
} }

View file

@ -4,7 +4,7 @@
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework> <TargetFramework>netcoreapp2.0</TargetFramework>
<RootNamespace>Noikoio.RegexBot</RootNamespace> <RootNamespace>Noikoio.RegexBot</RootNamespace>
<AssemblyVersion>2.3.1.0</AssemblyVersion> <AssemblyVersion>2.3.2.0</AssemblyVersion>
<Description>Highly configurable Discord moderation bot</Description> <Description>Highly configurable Discord moderation bot</Description>
<Authors>Noikoio</Authors> <Authors>Noikoio</Authors>
<Company /> <Company />