inital init
This commit is contained in:
parent
6897e40fcc
commit
6a7cf70640
1 changed files with 19 additions and 0 deletions
19
functions/CMD_hub_ban_user.js
Normal file
19
functions/CMD_hub_ban_user.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
module.exports.run = async (client, message, args, config) => {
|
||||
// get subcmd from args
|
||||
const [subcmd, type, messageID, reason] = args;
|
||||
if (!messageID || !reason) {
|
||||
return messageFail(client, message,
|
||||
`Command usage:
|
||||
\`\`\`${config.prefix}${module.exports.help.parent} ${subcmd} ${type || 'user'} ${messageID || 'MESSAGEID'} ${reason || 'REASON'}\`\`\``);
|
||||
}
|
||||
// get complete reason
|
||||
let cutLength = 0;
|
||||
[subcmd, type, messageID].map((arg) => cutLength = cutLength + arg.length + 1);
|
||||
const slicedReason = await args.join(' ').slice(cutLength);
|
||||
messageSuccess(message, `\`\`\`${slicedReason}\`\`\``);
|
||||
};
|
||||
|
||||
module.exports.help = {
|
||||
name: 'CMD_hub_ban_user',
|
||||
parent: 'hub',
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue