Early behavior fixups:

- Priorities are now higher number -> higher priority
- Priorities are now actually respected
- Early behaviors now print custom messages when they perform an action (Filter trigger, blacklist, poll vote, etc)
- small cleanup
This commit is contained in:
Kwoth
2021-07-03 01:46:32 +02:00
parent e681978f83
commit aeb6f8662c
9 changed files with 77 additions and 36 deletions

View File

@@ -48,8 +48,7 @@ namespace NadekoBot.Modules.CustomReactions.Services
private CustomReaction[] _globalReactions;
private ConcurrentDictionary<ulong, CustomReaction[]> _newGuildReactions;
public int Priority => -1;
public ModuleBehaviorType BehaviorType => ModuleBehaviorType.Executor;
public int Priority => 0;
private readonly DbService _db;
private readonly DiscordSocketClient _client;
@@ -395,6 +394,10 @@ namespace NadekoBot.Modules.CustomReactions.Services
{
if (_gperm.BlockedModules.Contains("ActualCustomReactions"))
{
Log.Information("User {UserName} [{UserId}] tried to use a custom reaction but 'ActualCustomReactions' are globally disabled.",
msg.Author.ToString(),
msg.Author.Id);
return true;
}
@@ -454,6 +457,13 @@ namespace NadekoBot.Modules.CustomReactions.Services
}
}
Log.Information("s: {GuildId} c: {ChannelId} u: {UserId} | {UserName} executed expression {Expr}",
guild.Id,
msg.Channel.Id,
msg.Author.Id,
msg.Author.ToString(),
cr.Trigger);
return true;
}
catch (Exception ex)