diff --git a/src/NadekoBot/Common/TypeReaders/BotCommandTypeReader.cs b/src/NadekoBot/Common/TypeReaders/BotCommandTypeReader.cs index a0359e764..5d53b2a65 100644 --- a/src/NadekoBot/Common/TypeReaders/BotCommandTypeReader.cs +++ b/src/NadekoBot/Common/TypeReaders/BotCommandTypeReader.cs @@ -31,38 +31,38 @@ public sealed class CommandTypeReader : NadekoTypeReader } } -public sealed class CommandOrCrTypeReader : NadekoTypeReader +public sealed class CommandOrExprTypeReader : NadekoTypeReader { private readonly CommandService _cmds; private readonly CommandHandler _commandHandler; private readonly NadekoExpressionsService _exprs; - public CommandOrCrTypeReader(CommandService cmds, NadekoExpressionsService exprs, CommandHandler commandHandler) + public CommandOrExprTypeReader(CommandService cmds, NadekoExpressionsService exprs, CommandHandler commandHandler) { _cmds = cmds; _exprs = exprs; _commandHandler = commandHandler; } - public override async ValueTask> ReadAsync(ICommandContext ctx, string input) + public override async ValueTask> ReadAsync(ICommandContext ctx, string input) { input = input.ToUpperInvariant(); if (_exprs.ExpressionExists(ctx.Guild?.Id, input) || _exprs.ExpressionExists(null, input)) - return TypeReaderResult.FromSuccess(new CommandOrCrInfo(input, CommandOrCrInfo.Type.Custom)); + return TypeReaderResult.FromSuccess(new CommandOrExprInfo(input, CommandOrExprInfo.Type.Custom)); var cmd = await new CommandTypeReader(_commandHandler, _cmds).ReadAsync(ctx, input); if (cmd.IsSuccess) { - return TypeReaderResult.FromSuccess(new CommandOrCrInfo(((CommandInfo)cmd.Values.First().Value).Name, - CommandOrCrInfo.Type.Normal)); + return TypeReaderResult.FromSuccess(new CommandOrExprInfo(((CommandInfo)cmd.Values.First().Value).Name, + CommandOrExprInfo.Type.Normal)); } - return TypeReaderResult.FromError(CommandError.ParseFailed, "No such command or cr found."); + return TypeReaderResult.FromError(CommandError.ParseFailed, "No such command or expression found."); } } -public class CommandOrCrInfo +public class CommandOrExprInfo { public enum Type { @@ -76,7 +76,7 @@ public class CommandOrCrInfo public bool IsCustom => CmdType == Type.Custom; - public CommandOrCrInfo(string input, Type type) + public CommandOrExprInfo(string input, Type type) { Name = input; CmdType = type; diff --git a/src/NadekoBot/Modules/Administration/PermOverrides/DiscordPermOverrideCommands.cs b/src/NadekoBot/Modules/Administration/PermOverrides/DiscordPermOverrideCommands.cs index d1f8eeea5..92848b839 100644 --- a/src/NadekoBot/Modules/Administration/PermOverrides/DiscordPermOverrideCommands.cs +++ b/src/NadekoBot/Modules/Administration/PermOverrides/DiscordPermOverrideCommands.cs @@ -14,7 +14,7 @@ public partial class Administration [Cmd] [RequireContext(ContextType.Guild)] [UserPerm(GuildPerm.Administrator)] - public async partial Task DiscordPermOverride(CommandOrCrInfo cmd, params GuildPerm[] perms) + public async partial Task DiscordPermOverride(CommandOrExprInfo cmd, params GuildPerm[] perms) { if (perms is null || perms.Length == 0) { diff --git a/src/NadekoBot/Modules/CustomReactions/NadekoExpressionsService.cs b/src/NadekoBot/Modules/CustomReactions/NadekoExpressionsService.cs index 3cfef526b..9dab77b5a 100644 --- a/src/NadekoBot/Modules/CustomReactions/NadekoExpressionsService.cs +++ b/src/NadekoBot/Modules/CustomReactions/NadekoExpressionsService.cs @@ -189,7 +189,7 @@ public sealed class NadekoExpressionsService : IExecOnMessage, IReadyExecutor continue; } - // if CA is disabled, and CR has AllowTarget, then the + // if CA is disabled, and expr has AllowTarget, then the // content has to start with the trigger followed by a space if (expr.AllowTarget && content.StartsWith(trigger, StringComparison.OrdinalIgnoreCase) diff --git a/src/NadekoBot/Modules/Help/Help.cs b/src/NadekoBot/Modules/Help/Help.cs index f6088251b..23b08cdaf 100644 --- a/src/NadekoBot/Modules/Help/Help.cs +++ b/src/NadekoBot/Modules/Help/Help.cs @@ -145,7 +145,7 @@ public partial class Help : NadekoModule return "❓"; case "administration": return "🛠️"; - case "customreactions": + case "expressions": return "🗣️"; case "searches": return "🔍"; diff --git a/src/NadekoBot/Modules/Permissions/CommandCooldown/CmdCdsCommands.cs b/src/NadekoBot/Modules/Permissions/CommandCooldown/CmdCdsCommands.cs index e8dedc3ff..d17434e18 100644 --- a/src/NadekoBot/Modules/Permissions/CommandCooldown/CmdCdsCommands.cs +++ b/src/NadekoBot/Modules/Permissions/CommandCooldown/CmdCdsCommands.cs @@ -79,7 +79,7 @@ public partial class Permissions [Cmd] [RequireContext(ContextType.Guild)] [Priority(1)] - public partial Task CmdCooldown(CommandOrCrInfo command, int secs) + public partial Task CmdCooldown(CommandOrExprInfo command, int secs) => CmdCooldownInternal(command.Name, secs); [Cmd] diff --git a/src/NadekoBot/Modules/Permissions/GlobalPermissions/GlobalPermissionCommands.cs b/src/NadekoBot/Modules/Permissions/GlobalPermissions/GlobalPermissionCommands.cs index 382e40e92..c537cab7e 100644 --- a/src/NadekoBot/Modules/Permissions/GlobalPermissions/GlobalPermissionCommands.cs +++ b/src/NadekoBot/Modules/Permissions/GlobalPermissions/GlobalPermissionCommands.cs @@ -60,7 +60,7 @@ public partial class Permissions [Cmd] [OwnerOnly] - public async partial Task GlobalCommand(CommandOrCrInfo cmd) + public async partial Task GlobalCommand(CommandOrExprInfo cmd) { var commandName = cmd.Name.ToLowerInvariant(); var added = _service.ToggleCommand(commandName); diff --git a/src/NadekoBot/Modules/Permissions/Permissions.cs b/src/NadekoBot/Modules/Permissions/Permissions.cs index 12e12c87a..b94dd08df 100644 --- a/src/NadekoBot/Modules/Permissions/Permissions.cs +++ b/src/NadekoBot/Modules/Permissions/Permissions.cs @@ -204,7 +204,7 @@ public partial class Permissions : NadekoModule [Cmd] [RequireContext(ContextType.Guild)] - public async partial Task SrvrCmd(CommandOrCrInfo command, PermissionAction action) + public async partial Task SrvrCmd(CommandOrExprInfo command, PermissionAction action) { await _service.AddPermissions(ctx.Guild.Id, new Permissionv2 @@ -245,7 +245,7 @@ public partial class Permissions : NadekoModule [Cmd] [RequireContext(ContextType.Guild)] - public async partial Task UsrCmd(CommandOrCrInfo command, PermissionAction action, [Leftover] IGuildUser user) + public async partial Task UsrCmd(CommandOrExprInfo command, PermissionAction action, [Leftover] IGuildUser user) { await _service.AddPermissions(ctx.Guild.Id, new Permissionv2 @@ -302,7 +302,7 @@ public partial class Permissions : NadekoModule [Cmd] [RequireContext(ContextType.Guild)] - public async partial Task RoleCmd(CommandOrCrInfo command, PermissionAction action, [Leftover] IRole role) + public async partial Task RoleCmd(CommandOrExprInfo command, PermissionAction action, [Leftover] IRole role) { if (role == role.Guild.EveryoneRole) return; @@ -366,7 +366,7 @@ public partial class Permissions : NadekoModule [Cmd] [RequireContext(ContextType.Guild)] - public async partial Task ChnlCmd(CommandOrCrInfo command, PermissionAction action, [Leftover] ITextChannel chnl) + public async partial Task ChnlCmd(CommandOrExprInfo command, PermissionAction action, [Leftover] ITextChannel chnl) { await _service.AddPermissions(ctx.Guild.Id, new Permissionv2