Log guild name along with channel on rule match
This commit is contained in:
parent
a8b4dfd4c3
commit
01b2ef1f1b
2 changed files with 3 additions and 3 deletions
|
@ -75,7 +75,7 @@ namespace Noikoio.RegexBot.Feature.AutoMod
|
||||||
if (!r.Match(m, isMod)) return;
|
if (!r.Match(m, isMod)) return;
|
||||||
|
|
||||||
// TODO make log optional; configurable
|
// 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)
|
foreach (Response resp in r.Response)
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace Noikoio.RegexBot.Feature.AutoRespond
|
||||||
// Check rate limit
|
// Check rate limit
|
||||||
if (!def.RateLimit.AllowUsage(msg.Channel.Id)) return;
|
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;
|
var (type, text) = def.Response;
|
||||||
if (type == ResponseDefinition.ResponseType.Reply) await ProcessReply(msg, text);
|
if (type == ResponseDefinition.ResponseType.Reply) await ProcessReply(msg, text);
|
||||||
else if (type == ResponseDefinition.ResponseType.Exec) await ProcessExec(msg, text);
|
else if (type == ResponseDefinition.ResponseType.Exec) await ProcessExec(msg, text);
|
||||||
|
|
Loading…
Reference in a new issue