Log guild name along with channel on rule match

This commit is contained in:
Noikoio 2017-09-04 18:55:03 -07:00
parent a8b4dfd4c3
commit 01b2ef1f1b
2 changed files with 3 additions and 3 deletions

View file

@ -75,7 +75,7 @@ namespace Noikoio.RegexBot.Feature.AutoMod
if (!r.Match(m, isMod)) return;
// TODO make log optional; configurable
await Log($"{r} triggered by {m.Author.ToString()}");
await Log($"{r} triggered by {m.Author} in {((SocketGuildChannel)m.Channel).Guild.Name}/#{m.Channel.Name}");
foreach (Response resp in r.Response)
{

View file

@ -17,7 +17,7 @@ namespace Noikoio.RegexBot.Feature.AutoRespond
// Check rate limit
if (!def.RateLimit.AllowUsage(msg.Channel.Id)) return;
await Log($"'{def.Label}' triggered in #{msg.Channel.Name} by {msg.Author}");
await Log($"'{def.Label}' triggered by {msg.Author} in {((SocketGuildChannel)msg.Channel).Guild.Name}/#{msg.Channel.Name}");
var (type, text) = def.Response;
if (type == ResponseDefinition.ResponseType.Reply) await ProcessReply(msg, text);
else if (type == ResponseDefinition.ResponseType.Exec) await ProcessExec(msg, text);