Update command documentation
This commit is contained in:
parent
8a15e2a3a3
commit
c4ac1f789f
25 changed files with 52 additions and 161 deletions
|
@ -1,52 +0,0 @@
|
||||||
import SimpleCommand from "../../../struct/commands/SimpleCommand";
|
|
||||||
import { inspect } from 'util';
|
|
||||||
import MessageCommandContext from "../../../struct/MessageCommandContext";
|
|
||||||
import CommandCategory from "../../../struct/commands/CommandCategory";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'eval',
|
|
||||||
aliases: [ 'e' ],
|
|
||||||
description: 'Evaluate JS code',
|
|
||||||
restrict: 'BOTOWNER',
|
|
||||||
removeEmptyArgs: false,
|
|
||||||
category: CommandCategory.Owner,
|
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
|
||||||
let cmd = args.join(' ');
|
|
||||||
|
|
||||||
let m = await message.channel?.sendMessage(`Executing...`);
|
|
||||||
|
|
||||||
try {
|
|
||||||
let e = eval(cmd);
|
|
||||||
|
|
||||||
if (e instanceof Promise) {
|
|
||||||
await m?.edit({ content: `## **Promise**<pending>` });
|
|
||||||
e.then((res) => {
|
|
||||||
m?.edit({
|
|
||||||
content: `## **Promise**<resolved>\n\`\`\`js\n${render(res)}\n\`\`\``
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch((res) => {
|
|
||||||
m?.edit({
|
|
||||||
content: `## **Promise**<rejected>\n\`\`\`js\n${render(res)}\n\`\`\``
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
message.channel?.sendMessage(`\`\`\`js\n${render(e)}\n\`\`\``);
|
|
||||||
}
|
|
||||||
} catch(e) {
|
|
||||||
m?.edit({ content: `## Execution failed\n\`\`\`js\n${render(e)}\n\`\`\`` });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} as SimpleCommand;
|
|
||||||
|
|
||||||
function removeSecrets(input: string): string {
|
|
||||||
if (process.env['DB_PASS']) input = input.replace(new RegExp(process.env['DB_PASS']!, 'gi'), '[Secret redacted]');
|
|
||||||
if (process.env['DB_URL']) input = input.replace(new RegExp(process.env['DB_URL']!, 'gi'), '[Secret redacted]');
|
|
||||||
input = input.replace(new RegExp(process.env['BOT_TOKEN']!, 'gi'), '[Secret redacted]');
|
|
||||||
|
|
||||||
return input;
|
|
||||||
}
|
|
||||||
|
|
||||||
function render(input: any): string {
|
|
||||||
return removeSecrets(inspect(input)).substr(0, 1960);
|
|
||||||
}
|
|
|
@ -1,47 +0,0 @@
|
||||||
import SimpleCommand from "../../../struct/commands/SimpleCommand";
|
|
||||||
import { exec } from 'child_process';
|
|
||||||
import MessageCommandContext from "../../../struct/MessageCommandContext";
|
|
||||||
import CommandCategory from "../../../struct/commands/CommandCategory";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'shell',
|
|
||||||
aliases: [ 'exec', 'sh' ],
|
|
||||||
description: 'Run code in a shell',
|
|
||||||
restrict: 'BOTOWNER',
|
|
||||||
removeEmptyArgs: false,
|
|
||||||
category: CommandCategory.Owner,
|
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
|
||||||
let cmd = args.join(' ');
|
|
||||||
|
|
||||||
let m = await message.channel?.sendMessage(`Executing...`);
|
|
||||||
|
|
||||||
try {
|
|
||||||
let editMsg = () => {
|
|
||||||
if (str != '' && str != oldStr) {
|
|
||||||
if (str.length > 2000) {
|
|
||||||
str = str.substr(str.length - 2000);
|
|
||||||
}
|
|
||||||
|
|
||||||
m?.edit({ content: str })
|
|
||||||
.catch(e => console.warn('Failed to edit message', e));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let str = '', oldStr = '';
|
|
||||||
let e = exec(cmd);
|
|
||||||
let i = setInterval(editMsg, 1000);
|
|
||||||
|
|
||||||
e.stdout?.on('data', m => {
|
|
||||||
str += m;
|
|
||||||
});
|
|
||||||
|
|
||||||
e.on('exit', (code) => {
|
|
||||||
clearInterval(i);
|
|
||||||
str += `\n\n**Exit code:** ${code}`;
|
|
||||||
editMsg();
|
|
||||||
});
|
|
||||||
} catch(e) {
|
|
||||||
message.channel?.sendMessage(`${e}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} as SimpleCommand;
|
|
|
@ -10,7 +10,7 @@ const SYNTAX = '/admin add @user; /admin remove @user; /admin list';
|
||||||
export default {
|
export default {
|
||||||
name: 'admin',
|
name: 'admin',
|
||||||
aliases: [ 'admins', 'manager', 'managers' ],
|
aliases: [ 'admins', 'manager', 'managers' ],
|
||||||
description: 'Allow users to control the bot\'s configuration',
|
description: "Manage users with permission to modify the configuration.",
|
||||||
syntax: SYNTAX,
|
syntax: SYNTAX,
|
||||||
category: CommandCategory.Config,
|
category: CommandCategory.Config,
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
|
|
|
@ -14,7 +14,7 @@ const WORDLIST_DEFAULT_MESSAGE = "<@{{user_id}}>, the message you sent contained
|
||||||
export default {
|
export default {
|
||||||
name: "botctl",
|
name: "botctl",
|
||||||
aliases: null,
|
aliases: null,
|
||||||
description: "Perform administrative actions",
|
description: "Perform administrative actions.",
|
||||||
category: CommandCategory.Config,
|
category: CommandCategory.Config,
|
||||||
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);
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { DEFAULT_PREFIX } from "../../modules/command_handler";
|
||||||
export default {
|
export default {
|
||||||
name: 'login',
|
name: 'login',
|
||||||
aliases: null,
|
aliases: null,
|
||||||
description: 'Log into the web dashboard',
|
description: 'Log into the web dashboard.',
|
||||||
category: CommandCategory.Miscellaneous,
|
category: CommandCategory.Miscellaneous,
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { DEFAULT_PREFIX } from "../../modules/command_handler";
|
||||||
export default {
|
export default {
|
||||||
name: 'logout',
|
name: 'logout',
|
||||||
aliases: null,
|
aliases: null,
|
||||||
description: 'Log out of sessions created with /login',
|
description: 'Log out of web dashboard sessions.',
|
||||||
category: CommandCategory.Miscellaneous,
|
category: CommandCategory.Miscellaneous,
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -12,7 +12,7 @@ const SYNTAX = '/mod add @user; /mod remove @user; /mod list';
|
||||||
export default {
|
export default {
|
||||||
name: 'moderator',
|
name: 'moderator',
|
||||||
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.Config,
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
|
|
|
@ -11,7 +11,7 @@ const MENTION_TEXT = 'You can also @mention me instead of using the prefix.';
|
||||||
export default {
|
export default {
|
||||||
name: 'prefix',
|
name: 'prefix',
|
||||||
aliases: null,
|
aliases: null,
|
||||||
description: 'Configure AutoMod\'s prefix',
|
description: "Change AutoMod's prefix",
|
||||||
syntax: SYNTAX,
|
syntax: SYNTAX,
|
||||||
category: CommandCategory.Config,
|
category: CommandCategory.Config,
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
import CommandCategory from "../../../struct/commands/CommandCategory";
|
|
||||||
import SimpleCommand from "../../../struct/commands/SimpleCommand";
|
|
||||||
import MessageCommandContext from "../../../struct/MessageCommandContext";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'settings',
|
|
||||||
aliases: [ 'setting' ],
|
|
||||||
description: 'Manage AutoMod\'s configuration',
|
|
||||||
category: CommandCategory.Config,
|
|
||||||
run: async (message: MessageCommandContext) => {
|
|
||||||
await message.reply(`Bot configuration can be managed from `
|
|
||||||
+ `[here](<${process.env['WEB_UI_URL'] || 'https://automod.vale.rocks'}/dashboard>).`);
|
|
||||||
}
|
|
||||||
} as SimpleCommand;
|
|
|
@ -11,7 +11,7 @@ const SYNTAX = '/whitelist add @user; /whitelist remove @user; /whitelist list';
|
||||||
export default {
|
export default {
|
||||||
name: 'whitelist',
|
name: 'whitelist',
|
||||||
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.Config,
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
import CommandCategory from "../../../struct/commands/CommandCategory";
|
|
||||||
import SimpleCommand from "../../../struct/commands/SimpleCommand";
|
|
||||||
import MessageCommandContext from "../../../struct/MessageCommandContext";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'healthcheck',
|
|
||||||
aliases: null,
|
|
||||||
description: 'Health check',
|
|
||||||
category: CommandCategory.Miscellaneous,
|
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
|
||||||
await message.reply('Health check success: ' + args.join(' '));
|
|
||||||
}
|
|
||||||
} as SimpleCommand;
|
|
|
@ -12,27 +12,27 @@ const categories: {
|
||||||
} = {
|
} = {
|
||||||
[CommandCategory.Moderation]: {
|
[CommandCategory.Moderation]: {
|
||||||
friendlyName: "Moderation",
|
friendlyName: "Moderation",
|
||||||
description: "Moderation-focused commands",
|
description: "Commands for enforcing server rules.",
|
||||||
aliases: ["moderation", "mod"],
|
aliases: ["moderation", "mod"],
|
||||||
},
|
},
|
||||||
[CommandCategory.Config]: {
|
[CommandCategory.Config]: {
|
||||||
friendlyName: "Configuration",
|
friendlyName: "Configuration",
|
||||||
description: "Configure AutoMod",
|
description: "Commands for setting up and customizing settings.",
|
||||||
aliases: ["configuration", "config", "conf"],
|
aliases: ["configuration", "config", "conf"],
|
||||||
},
|
},
|
||||||
[CommandCategory.Owner]: {
|
[CommandCategory.Owner]: {
|
||||||
friendlyName: "Owner",
|
friendlyName: "Owner",
|
||||||
description: "Owner-only commands for managing AutoMod",
|
description: "Exclusive commands for the bot owner to manage and control AutoMod.",
|
||||||
aliases: ["owner"],
|
aliases: ["owner"],
|
||||||
},
|
},
|
||||||
[CommandCategory.Miscellaneous]: {
|
[CommandCategory.Miscellaneous]: {
|
||||||
friendlyName: "Miscellaneous",
|
friendlyName: "Miscellaneous",
|
||||||
description: "Assorted extras",
|
description: "Additional commands not covered by other categories.",
|
||||||
aliases: ["miscellaneous", "misc"],
|
aliases: ["miscellaneous", "misc"],
|
||||||
},
|
},
|
||||||
[CommandCategory.None]: {
|
[CommandCategory.None]: {
|
||||||
friendlyName: "Uncategorized",
|
friendlyName: "Uncategorized",
|
||||||
description: "Uncategorized commands",
|
description: "Commands that haven't been assigned to a specific category.",
|
||||||
aliases: [],
|
aliases: [],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -40,7 +40,7 @@ const categories: {
|
||||||
export default {
|
export default {
|
||||||
name: "help",
|
name: "help",
|
||||||
aliases: null,
|
aliases: null,
|
||||||
description: "Help command.",
|
description: "Displays usage instructions.",
|
||||||
removeEmptyArgs: true,
|
removeEmptyArgs: true,
|
||||||
category: CommandCategory.Miscellaneous,
|
category: CommandCategory.Miscellaneous,
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
|
@ -51,9 +51,7 @@ export default {
|
||||||
if (!searchInput) {
|
if (!searchInput) {
|
||||||
let msg =
|
let msg =
|
||||||
`## AutoMod Help\n` +
|
`## AutoMod Help\n` +
|
||||||
`Type **${prefix}help [category]** to view see all commands or **${prefix}help [command]** to learn more about a command.\n\n` +
|
`Type \`${prefix}help [category]\` to view commands within a category, or \`${prefix}help [command]\` to learn more about a specific command.\n\n`;
|
||||||
`### [Open Server Settings]` +
|
|
||||||
`(<${process.env['WEB_UI_URL'] || "https://automod.vale.rocks"}/dashboard/${message.channel?.serverId}>)\n\n`;
|
|
||||||
|
|
||||||
let total = 0;
|
let total = 0;
|
||||||
|
|
||||||
|
@ -67,7 +65,9 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
msg += `\n##### Categories: ${total}`;
|
msg += `\n##### Categories: ${total}\n\n` +
|
||||||
|
`[Open Server Settings]` +
|
||||||
|
`(<${process.env['WEB_UI_URL'] || "https://automod.vale.rocks"}/dashboard/${message.channel?.serverId}>)`;
|
||||||
|
|
||||||
await message.reply(msg);
|
await message.reply(msg);
|
||||||
} else {
|
} else {
|
||||||
|
@ -76,17 +76,18 @@ export default {
|
||||||
Object.entries(categories).find((c) => c[1].aliases.find((k) => k.toLowerCase() == searchInput)) ||
|
Object.entries(categories).find((c) => c[1].aliases.find((k) => k.toLowerCase() == searchInput)) ||
|
||||||
[];
|
[];
|
||||||
if (category && !searchInput.startsWith(prefix)) {
|
if (category && !searchInput.startsWith(prefix)) {
|
||||||
let msg = `**AutoMod Help** - Category: ${category.friendlyName}\n` + `${category.description}\n\n` + `Type **${prefix}help [command]** to learn more about a command.\n\n`;
|
let msg = `## AutoMod Help - ${category.friendlyName}\n` +
|
||||||
|
`${category.description}\n\n` +
|
||||||
|
`Type \`${prefix}help [command]\` to learn more about a specific command.\n\n`;
|
||||||
|
|
||||||
let cmdList = commands.filter((c) => (c.category || "uncategorized") == categoryName);
|
let cmdList = commands.filter((c) => (c.category || "uncategorized") == categoryName);
|
||||||
if (cmdList.length > 0) {
|
if (cmdList.length > 0) {
|
||||||
for (const cmd of cmdList) {
|
for (const cmd of cmdList) {
|
||||||
msg += `**${prefix}${cmd.name}** \u200b $\\big |$ \u200b ${cmd.description}\n`;
|
msg += `**${prefix}${cmd.name}** - ${cmd.description}`;
|
||||||
|
|
||||||
msg += "\n";
|
msg += "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
msg += `##### Total: ${cmdList.length}`;
|
msg += `##### ${category.friendlyName} Commands: ${cmdList.length}`;
|
||||||
} else msg += `### This category is empty.`;
|
} else msg += `### This category is empty.`;
|
||||||
|
|
||||||
await message.reply(msg);
|
await message.reply(msg);
|
||||||
|
@ -97,7 +98,8 @@ export default {
|
||||||
if (!cmd) {
|
if (!cmd) {
|
||||||
return message.reply(`I can't find any command or category matching \`${searchInput}\`.`);
|
return message.reply(`I can't find any command or category matching \`${searchInput}\`.`);
|
||||||
} else {
|
} else {
|
||||||
let msg = `**AutoMod Help** - Command: ${cmd.name}\n` + `${cmd.description}\n\n`;
|
let msg = `## AutoMod Help - ${cmd.name}\n` +
|
||||||
|
`${cmd.description}\n\n`;
|
||||||
|
|
||||||
if (cmd.syntax) msg += `Syntax: \`${cmd.syntax}\`\n`;
|
if (cmd.syntax) msg += `Syntax: \`${cmd.syntax}\`\n`;
|
||||||
msg += "Aliases: " + (cmd.aliases ? `\`${cmd.aliases.join(`\`, \``)}\`` : "None") + "\n";
|
msg += "Aliases: " + (cmd.aliases ? `\`${cmd.aliases.join(`\`, \``)}\`` : "None") + "\n";
|
||||||
|
|
|
@ -6,7 +6,7 @@ import CommandCategory from "../../../struct/commands/CommandCategory";
|
||||||
export default {
|
export default {
|
||||||
name: "ping",
|
name: "ping",
|
||||||
aliases: null,
|
aliases: null,
|
||||||
description: "ping pong",
|
description: "Checks response times.",
|
||||||
category: CommandCategory.Miscellaneous,
|
category: CommandCategory.Miscellaneous,
|
||||||
run: async (message: MessageCommandContext) => {
|
run: async (message: MessageCommandContext) => {
|
||||||
let now = Date.now();
|
let now = Date.now();
|
||||||
|
|
15
bot/src/bot/commands/misc/support.ts
Normal file
15
bot/src/bot/commands/misc/support.ts
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
import CommandCategory from "../../../struct/commands/CommandCategory";
|
||||||
|
import SimpleCommand from "../../../struct/commands/SimpleCommand";
|
||||||
|
import MessageCommandContext from "../../../struct/MessageCommandContext";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "support",
|
||||||
|
aliases: ["donate", "tip"],
|
||||||
|
description: "Financially support AutoMod development and hosting.",
|
||||||
|
category: CommandCategory.Miscellaneous,
|
||||||
|
run: async (message: MessageCommandContext) => {
|
||||||
|
message.reply({
|
||||||
|
content: "AutoMod is hosted and developed free of charge, but your financial support is greatly appreciated. You can support me via https://vale.rocks/support. Thank you so very much!",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
} as SimpleCommand;
|
|
@ -5,7 +5,7 @@ import MessageCommandContext from "../../../struct/MessageCommandContext";
|
||||||
export default {
|
export default {
|
||||||
name: "test",
|
name: "test",
|
||||||
aliases: ["testalias"],
|
aliases: ["testalias"],
|
||||||
description: "Test command",
|
description: "Tests that the bot works.",
|
||||||
category: CommandCategory.Miscellaneous,
|
category: CommandCategory.Miscellaneous,
|
||||||
run: async (message: MessageCommandContext) => {
|
run: async (message: MessageCommandContext) => {
|
||||||
message.reply({
|
message.reply({
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { isModerator, NO_MANAGER_MSG, parseUser } from "../../util";
|
||||||
export default {
|
export default {
|
||||||
name: 'avatar',
|
name: 'avatar',
|
||||||
aliases: [ 'pfp' ],
|
aliases: [ 'pfp' ],
|
||||||
description: 'Get or clear someone\'s avatar',
|
description: 'Manage or return a user\'s profile picture.',
|
||||||
category: CommandCategory.Moderation,
|
category: CommandCategory.Moderation,
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -32,7 +32,7 @@ Day.extend(RelativeTime);
|
||||||
export default {
|
export default {
|
||||||
name: "ban",
|
name: "ban",
|
||||||
aliases: ["eject"],
|
aliases: ["eject"],
|
||||||
description: "Ban a member from the server",
|
description: "Bans a user from the server.",
|
||||||
syntax: "/ban @username [10m|1h|...?] [reason?]",
|
syntax: "/ban @username [10m|1h|...?] [reason?]",
|
||||||
removeEmptyArgs: true,
|
removeEmptyArgs: true,
|
||||||
category: CommandCategory.Moderation,
|
category: CommandCategory.Moderation,
|
||||||
|
|
|
@ -26,7 +26,7 @@ import {
|
||||||
export default {
|
export default {
|
||||||
name: "kick",
|
name: "kick",
|
||||||
aliases: ["yeet", "vent"],
|
aliases: ["yeet", "vent"],
|
||||||
description: "Kick a member from the server",
|
description: "Kick a user from the server.",
|
||||||
syntax: "/kick @username [reason?]",
|
syntax: "/kick @username [reason?]",
|
||||||
removeEmptyArgs: true,
|
removeEmptyArgs: true,
|
||||||
category: CommandCategory.Moderation,
|
category: CommandCategory.Moderation,
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { client } from "../../..";
|
||||||
export default {
|
export default {
|
||||||
name: 'nick',
|
name: 'nick',
|
||||||
aliases: [ 'setnick' ],
|
aliases: [ 'setnick' ],
|
||||||
description: 'Set or clear someone\'s nickname',
|
description: 'Manage a user\'s nickname.',
|
||||||
category: CommandCategory.Moderation,
|
category: CommandCategory.Moderation,
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -11,7 +11,7 @@ const MAX_PURGE_AMOUNT = 100;
|
||||||
export default {
|
export default {
|
||||||
name: "purge",
|
name: "purge",
|
||||||
aliases: ["clear"],
|
aliases: ["clear"],
|
||||||
description: "Mass delete messages",
|
description: "Delete messages in bulk.",
|
||||||
syntax: SYNTAX,
|
syntax: SYNTAX,
|
||||||
category: CommandCategory.Moderation,
|
category: CommandCategory.Moderation,
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
|
|
|
@ -34,7 +34,7 @@ function parseTimeInput(input: string) {
|
||||||
export default {
|
export default {
|
||||||
name: 'timeout',
|
name: 'timeout',
|
||||||
aliases: [ 'mute' ],
|
aliases: [ 'mute' ],
|
||||||
description: 'Set a timeout on a user',
|
description: 'Set a timeout on a user.',
|
||||||
category: CommandCategory.Moderation,
|
category: CommandCategory.Moderation,
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { isModerator, NO_MANAGER_MSG, parseUser, ULID_REGEX, USER_MENTION_REGEX
|
||||||
export default {
|
export default {
|
||||||
name: 'unban',
|
name: 'unban',
|
||||||
aliases: [ 'pardon' ],
|
aliases: [ 'pardon' ],
|
||||||
description: 'Unbans a user',
|
description: "Removes a user's server ban.",
|
||||||
syntax: '/unban [@user or ID]',
|
syntax: '/unban [@user or ID]',
|
||||||
category: CommandCategory.Moderation,
|
category: CommandCategory.Moderation,
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
|
|
|
@ -19,7 +19,7 @@ type VoteEntry = {
|
||||||
export default {
|
export default {
|
||||||
name: 'votekick',
|
name: 'votekick',
|
||||||
aliases: [ 'voteban' ],
|
aliases: [ 'voteban' ],
|
||||||
description: 'Allow trusted users to vote kick users',
|
description: 'Allow trusted users to vote kick users.',
|
||||||
category: CommandCategory.Moderation,
|
category: CommandCategory.Moderation,
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -13,7 +13,7 @@ export default {
|
||||||
name: 'warn',
|
name: 'warn',
|
||||||
aliases: null,
|
aliases: null,
|
||||||
removeEmptyArgs: false,
|
removeEmptyArgs: false,
|
||||||
description: 'add an infraction to an user\'s record',
|
description: "Adds an infraction to a user's record.",
|
||||||
category: CommandCategory.Moderation,
|
category: CommandCategory.Moderation,
|
||||||
run: async (message, args, serverConfig) => {
|
run: async (message, args, serverConfig) => {
|
||||||
if (!await isModerator(message)) return message.reply(NO_MANAGER_MSG);
|
if (!await isModerator(message)) return message.reply(NO_MANAGER_MSG);
|
||||||
|
|
|
@ -17,8 +17,8 @@ const GLOBAL_BLACKLIST_TEXT = (reason?: string) => `> :warning: This user has be
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'warns',
|
name: 'warns',
|
||||||
aliases: [ 'warnings', 'infractions', 'infraction' ],
|
aliases: [ 'warnings', 'infractions' ],
|
||||||
description: 'Show all user infractions',
|
description: "Shows a user's infractions.",
|
||||||
syntax: '/warns; /warns @username ["export-csv"]; /warns rm [ID]',
|
syntax: '/warns; /warns @username ["export-csv"]; /warns rm [ID]',
|
||||||
category: CommandCategory.Moderation,
|
category: CommandCategory.Moderation,
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext, args: string[]) => {
|
||||||
|
|
Loading…
Reference in a new issue