From 05c40d4b21954ddee321d9d880d4c176cc757dbf Mon Sep 17 00:00:00 2001 From: Declan Chidlow Date: Fri, 16 Aug 2024 12:54:19 +0800 Subject: [PATCH] Fix some naming --- bot/src/bot/commands/configuration/bot_managers.ts | 2 +- bot/src/bot/commands/configuration/botctl.ts | 2 +- bot/src/bot/commands/configuration/moderator.ts | 2 +- bot/src/bot/commands/configuration/prefix.ts | 2 +- bot/src/bot/commands/configuration/whitelist.ts | 2 +- bot/src/bot/commands/{misc => miscellaneous}/help.ts | 2 +- bot/src/bot/commands/{misc => miscellaneous}/ping.ts | 0 bot/src/bot/commands/{misc => miscellaneous}/support.ts | 0 bot/src/bot/commands/{misc => miscellaneous}/test.ts | 0 bot/src/bot/commands/{admin => owner}/botadm.ts | 0 bot/src/bot/modules/command_handler.ts | 2 +- bot/src/bot/modules/event_handler.ts | 2 +- bot/src/bot/util.ts | 4 ++-- bot/src/struct/commands/CommandCategory.ts | 2 +- 14 files changed, 11 insertions(+), 11 deletions(-) rename bot/src/bot/commands/{misc => miscellaneous}/help.ts (99%) rename bot/src/bot/commands/{misc => miscellaneous}/ping.ts (100%) rename bot/src/bot/commands/{misc => miscellaneous}/support.ts (100%) rename bot/src/bot/commands/{misc => miscellaneous}/test.ts (100%) rename bot/src/bot/commands/{admin => owner}/botadm.ts (100%) diff --git a/bot/src/bot/commands/configuration/bot_managers.ts b/bot/src/bot/commands/configuration/bot_managers.ts index 0d86bd6..4298f08 100644 --- a/bot/src/bot/commands/configuration/bot_managers.ts +++ b/bot/src/bot/commands/configuration/bot_managers.ts @@ -12,7 +12,7 @@ export default { aliases: [ 'admins', 'manager', 'managers' ], description: "Manage users with permission to modify the configuration.", syntax: SYNTAX, - category: CommandCategory.Config, + category: CommandCategory.Configuration, run: async (message: MessageCommandContext, args: string[]) => { if (!message.member?.hasPermission(message.member.server!, 'ManageServer')) return message.reply('You need **ManageServer** permission to use this command.'); diff --git a/bot/src/bot/commands/configuration/botctl.ts b/bot/src/bot/commands/configuration/botctl.ts index 9cda8b6..e851812 100644 --- a/bot/src/bot/commands/configuration/botctl.ts +++ b/bot/src/bot/commands/configuration/botctl.ts @@ -15,7 +15,7 @@ export default { name: "botctl", aliases: null, description: "Perform administrative actions.", - category: CommandCategory.Config, + category: CommandCategory.Configuration, run: async (message: MessageCommandContext, args: string[]) => { if (!(await isBotManager(message))) return message.reply(NO_MANAGER_MSG); diff --git a/bot/src/bot/commands/configuration/moderator.ts b/bot/src/bot/commands/configuration/moderator.ts index 0fd46e7..c288fe2 100644 --- a/bot/src/bot/commands/configuration/moderator.ts +++ b/bot/src/bot/commands/configuration/moderator.ts @@ -14,7 +14,7 @@ export default { aliases: [ 'moderators', 'mod', 'mods' ], description: 'Allow users to moderate other users.', syntax: SYNTAX, - category: CommandCategory.Config, + category: CommandCategory.Configuration, run: async (message: MessageCommandContext, args: string[]) => { if (!await isBotManager(message)) return message.reply(NO_MANAGER_MSG); diff --git a/bot/src/bot/commands/configuration/prefix.ts b/bot/src/bot/commands/configuration/prefix.ts index 2a1d9c2..25aebc6 100644 --- a/bot/src/bot/commands/configuration/prefix.ts +++ b/bot/src/bot/commands/configuration/prefix.ts @@ -13,7 +13,7 @@ export default { aliases: null, description: "Change AutoMod's prefix", syntax: SYNTAX, - category: CommandCategory.Config, + category: CommandCategory.Configuration, run: async (message: MessageCommandContext, args: string[]) => { let config = await dbs.SERVERS.findOne({ id: message.channel!.serverId! }); diff --git a/bot/src/bot/commands/configuration/whitelist.ts b/bot/src/bot/commands/configuration/whitelist.ts index e613f34..e4a8d92 100644 --- a/bot/src/bot/commands/configuration/whitelist.ts +++ b/bot/src/bot/commands/configuration/whitelist.ts @@ -13,7 +13,7 @@ export default { aliases: [], description: 'Allow users or roles to bypass moderation rules.', syntax: SYNTAX, - category: CommandCategory.Config, + category: CommandCategory.Configuration, run: async (message: MessageCommandContext, args: string[]) => { let config: ServerConfig|null = await dbs.SERVERS.findOne({ id: message.serverContext.id }) if (!config) config = { id: message.channel!.serverId! }; diff --git a/bot/src/bot/commands/misc/help.ts b/bot/src/bot/commands/miscellaneous/help.ts similarity index 99% rename from bot/src/bot/commands/misc/help.ts rename to bot/src/bot/commands/miscellaneous/help.ts index ca34ea0..fbb0d3e 100644 --- a/bot/src/bot/commands/misc/help.ts +++ b/bot/src/bot/commands/miscellaneous/help.ts @@ -15,7 +15,7 @@ const categories: { description: "Commands for enforcing server rules.", aliases: ["moderation", "mod"], }, - [CommandCategory.Config]: { + [CommandCategory.Configuration]: { friendlyName: "Configuration", description: "Commands for setting up and customizing settings.", aliases: ["configuration", "config", "conf"], diff --git a/bot/src/bot/commands/misc/ping.ts b/bot/src/bot/commands/miscellaneous/ping.ts similarity index 100% rename from bot/src/bot/commands/misc/ping.ts rename to bot/src/bot/commands/miscellaneous/ping.ts diff --git a/bot/src/bot/commands/misc/support.ts b/bot/src/bot/commands/miscellaneous/support.ts similarity index 100% rename from bot/src/bot/commands/misc/support.ts rename to bot/src/bot/commands/miscellaneous/support.ts diff --git a/bot/src/bot/commands/misc/test.ts b/bot/src/bot/commands/miscellaneous/test.ts similarity index 100% rename from bot/src/bot/commands/misc/test.ts rename to bot/src/bot/commands/miscellaneous/test.ts diff --git a/bot/src/bot/commands/admin/botadm.ts b/bot/src/bot/commands/owner/botadm.ts similarity index 100% rename from bot/src/bot/commands/admin/botadm.ts rename to bot/src/bot/commands/owner/botadm.ts diff --git a/bot/src/bot/modules/command_handler.ts b/bot/src/bot/modules/command_handler.ts index ed5045d..3533260 100644 --- a/bot/src/bot/modules/command_handler.ts +++ b/bot/src/bot/modules/command_handler.ts @@ -8,7 +8,7 @@ import checkCustomRules from "./custom_rules/custom_rules"; import MessageCommandContext from "../../struct/MessageCommandContext"; import { fileURLToPath } from 'url'; import { getOwnMemberInServer } from "../util"; -import { isSudo, updateSudoTimeout } from "../commands/admin/botadm"; +import { isSudo, updateSudoTimeout } from "../commands/owner/botadm"; import { metrics } from "./metrics"; // thanks a lot esm diff --git a/bot/src/bot/modules/event_handler.ts b/bot/src/bot/modules/event_handler.ts index b5e6f28..d622a09 100644 --- a/bot/src/bot/modules/event_handler.ts +++ b/bot/src/bot/modules/event_handler.ts @@ -3,7 +3,7 @@ import crypto from "crypto"; import { client, dbs } from "../.."; import Infraction from "automod/dist/types/antispam/Infraction"; import InfractionType from "automod/dist/types/antispam/InfractionType"; -import { BLACKLIST_BAN_REASON, BLACKLIST_MESSAGE } from "../commands/admin/botadm"; +import { BLACKLIST_BAN_REASON, BLACKLIST_MESSAGE } from "../commands/owner/botadm"; import logger from "../logger"; import { storeInfraction } from "../util"; import { DEFAULT_PREFIX } from "./command_handler"; diff --git a/bot/src/bot/util.ts b/bot/src/bot/util.ts index 7772b46..b5a048b 100644 --- a/bot/src/bot/util.ts +++ b/bot/src/bot/util.ts @@ -10,11 +10,11 @@ import LogMessage from "automod/dist/types/LogMessage"; import logger from "./logger"; import { Channel } from "revolt.js"; import { Message } from "revolt.js"; -import { isSudo } from "./commands/admin/botadm"; +import { isSudo } from "./commands/owner/botadm"; import type { SendableEmbed } from "revolt-api"; import ServerConfig from "automod/dist/types/ServerConfig"; -const NO_MANAGER_MSG = "🔒 Missing permission"; +const NO_MANAGER_MSG = "Missing permission"; const ULID_REGEX = /^[0-9A-HJ-KM-NP-TV-Z]{26}$/i; const USER_MENTION_REGEX = /^<@[0-9A-HJ-KM-NP-TV-Z]{26}>$/i; const CHANNEL_MENTION_REGEX = /^<#[0-9A-HJ-KM-NP-TV-Z]{26}>$/i; diff --git a/bot/src/struct/commands/CommandCategory.ts b/bot/src/struct/commands/CommandCategory.ts index 828ae38..fc021fc 100644 --- a/bot/src/struct/commands/CommandCategory.ts +++ b/bot/src/struct/commands/CommandCategory.ts @@ -1,6 +1,6 @@ enum CommandCategory { Moderation = 'Moderation', - Config = 'Config', + Configuration = 'Configuration', Owner = 'Owner', Miscellaneous = 'Miscellaneous', None = 'None',