Fix some naming

This commit is contained in:
Declan Chidlow 2024-08-16 12:54:19 +08:00
parent c4ac1f789f
commit 05c40d4b21
14 changed files with 11 additions and 11 deletions

View file

@ -12,7 +12,7 @@ export default {
aliases: [ 'admins', 'manager', 'managers' ], aliases: [ 'admins', 'manager', 'managers' ],
description: "Manage users with permission to modify the configuration.", description: "Manage users with permission to modify the configuration.",
syntax: SYNTAX, syntax: SYNTAX,
category: CommandCategory.Config, category: CommandCategory.Configuration,
run: async (message: MessageCommandContext, args: string[]) => { run: async (message: MessageCommandContext, args: string[]) => {
if (!message.member?.hasPermission(message.member.server!, 'ManageServer')) if (!message.member?.hasPermission(message.member.server!, 'ManageServer'))
return message.reply('You need **ManageServer** permission to use this command.'); return message.reply('You need **ManageServer** permission to use this command.');

View file

@ -15,7 +15,7 @@ export default {
name: "botctl", name: "botctl",
aliases: null, aliases: null,
description: "Perform administrative actions.", description: "Perform administrative actions.",
category: CommandCategory.Config, category: CommandCategory.Configuration,
run: async (message: MessageCommandContext, args: string[]) => { run: async (message: MessageCommandContext, args: string[]) => {
if (!(await isBotManager(message))) return message.reply(NO_MANAGER_MSG); if (!(await isBotManager(message))) return message.reply(NO_MANAGER_MSG);

View file

@ -14,7 +14,7 @@ export default {
aliases: [ 'moderators', 'mod', 'mods' ], aliases: [ 'moderators', 'mod', 'mods' ],
description: 'Allow users to moderate other users.', description: 'Allow users to moderate other users.',
syntax: SYNTAX, syntax: SYNTAX,
category: CommandCategory.Config, category: CommandCategory.Configuration,
run: async (message: MessageCommandContext, args: string[]) => { run: async (message: MessageCommandContext, args: string[]) => {
if (!await isBotManager(message)) return message.reply(NO_MANAGER_MSG); if (!await isBotManager(message)) return message.reply(NO_MANAGER_MSG);

View file

@ -13,7 +13,7 @@ export default {
aliases: null, aliases: null,
description: "Change AutoMod's prefix", description: "Change AutoMod's prefix",
syntax: SYNTAX, syntax: SYNTAX,
category: CommandCategory.Config, category: CommandCategory.Configuration,
run: async (message: MessageCommandContext, args: string[]) => { run: async (message: MessageCommandContext, args: string[]) => {
let config = await dbs.SERVERS.findOne({ id: message.channel!.serverId! }); let config = await dbs.SERVERS.findOne({ id: message.channel!.serverId! });

View file

@ -13,7 +13,7 @@ export default {
aliases: [], aliases: [],
description: 'Allow users or roles to bypass moderation rules.', description: 'Allow users or roles to bypass moderation rules.',
syntax: SYNTAX, syntax: SYNTAX,
category: CommandCategory.Config, category: CommandCategory.Configuration,
run: async (message: MessageCommandContext, args: string[]) => { run: async (message: MessageCommandContext, args: string[]) => {
let config: ServerConfig|null = await dbs.SERVERS.findOne({ id: message.serverContext.id }) let config: ServerConfig|null = await dbs.SERVERS.findOne({ id: message.serverContext.id })
if (!config) config = { id: message.channel!.serverId! }; if (!config) config = { id: message.channel!.serverId! };

View file

@ -15,7 +15,7 @@ const categories: {
description: "Commands for enforcing server rules.", description: "Commands for enforcing server rules.",
aliases: ["moderation", "mod"], aliases: ["moderation", "mod"],
}, },
[CommandCategory.Config]: { [CommandCategory.Configuration]: {
friendlyName: "Configuration", friendlyName: "Configuration",
description: "Commands for setting up and customizing settings.", description: "Commands for setting up and customizing settings.",
aliases: ["configuration", "config", "conf"], aliases: ["configuration", "config", "conf"],

View file

@ -8,7 +8,7 @@ import checkCustomRules from "./custom_rules/custom_rules";
import MessageCommandContext from "../../struct/MessageCommandContext"; import MessageCommandContext from "../../struct/MessageCommandContext";
import { fileURLToPath } from 'url'; import { fileURLToPath } from 'url';
import { getOwnMemberInServer } from "../util"; import { getOwnMemberInServer } from "../util";
import { isSudo, updateSudoTimeout } from "../commands/admin/botadm"; import { isSudo, updateSudoTimeout } from "../commands/owner/botadm";
import { metrics } from "./metrics"; import { metrics } from "./metrics";
// thanks a lot esm // thanks a lot esm

View file

@ -3,7 +3,7 @@ import crypto from "crypto";
import { client, dbs } from "../.."; import { client, dbs } from "../..";
import Infraction from "automod/dist/types/antispam/Infraction"; import Infraction from "automod/dist/types/antispam/Infraction";
import InfractionType from "automod/dist/types/antispam/InfractionType"; 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 logger from "../logger";
import { storeInfraction } from "../util"; import { storeInfraction } from "../util";
import { DEFAULT_PREFIX } from "./command_handler"; import { DEFAULT_PREFIX } from "./command_handler";

View file

@ -10,11 +10,11 @@ import LogMessage from "automod/dist/types/LogMessage";
import logger from "./logger"; import logger from "./logger";
import { Channel } from "revolt.js"; import { Channel } from "revolt.js";
import { Message } 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 type { SendableEmbed } from "revolt-api";
import ServerConfig from "automod/dist/types/ServerConfig"; 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 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 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; const CHANNEL_MENTION_REGEX = /^<#[0-9A-HJ-KM-NP-TV-Z]{26}>$/i;

View file

@ -1,6 +1,6 @@
enum CommandCategory { enum CommandCategory {
Moderation = 'Moderation', Moderation = 'Moderation',
Config = 'Config', Configuration = 'Configuration',
Owner = 'Owner', Owner = 'Owner',
Miscellaneous = 'Miscellaneous', Miscellaneous = 'Miscellaneous',
None = 'None', None = 'None',