Sonar Cleanup - Phase 8

This commit is contained in:
Ean Milligan (Bastion) 2022-05-22 17:30:30 -04:00
parent 764b8c103b
commit bbba797dc3
3 changed files with 79 additions and 50 deletions

75
mod.ts
View File

@ -124,55 +124,84 @@ startBot({
// All commands below here // All commands below here
switch (command) {
case 'ping':
// [[ping // [[ping
// Its a ping test, what else do you want. // Its a ping test, what else do you want.
if (command === 'ping') {
commands.ping(message); commands.ping(message);
} // [[rip [[memory break;
case 'rip':
case 'memory':
// [[rip [[memory
// Displays a short message I wanted to include // Displays a short message I wanted to include
else if (command === 'rip' || command === 'memory') {
commands.rip(message); commands.rip(message);
} // [[rollhelp or [[rh or [[hr or [[?? break;
case 'rollhelp':
case 'rh':
case 'hr':
case '??':
// [[rollhelp or [[rh or [[hr or [[??
// Help command specifically for the roll command // Help command specifically for the roll command
else if (command === 'rollhelp' || command === 'rh' || command === 'hr' || command === '??' || command?.startsWith('xdy')) {
commands.rollHelp(message); commands.rollHelp(message);
} // [[help or [[h or [[? break;
case 'help':
case 'h':
case '?':
// [[help or [[h or [[?
// Help command, prints from help file // Help command, prints from help file
else if (command === 'help' || command === 'h' || command === '?') {
commands.help(message); commands.help(message);
} // [[info or [[i break;
case 'info':
case 'i':
// [[info or [[i
// Info command, prints short desc on bot and some links // Info command, prints short desc on bot and some links
else if (command === 'info' || command === 'i') {
commands.info(message); commands.info(message);
} // [[privacy break;
case 'privacy':
// [[privacy
// Privacy command, prints short desc on bot's privacy policy // Privacy command, prints short desc on bot's privacy policy
else if (command === 'privacy') {
commands.privacy(message); commands.privacy(message);
} // [[version or [[v break;
case 'version':
case 'v':
// [[version or [[v
// Returns version of the bot // Returns version of the bot
else if (command === 'version' || command === 'v') {
commands.version(message); commands.version(message);
} // [[report or [[r (command that failed) break;
case 'report':
case 'r':
// [[report or [[r (command that failed)
// Manually report a failed roll // Manually report a failed roll
else if (command === 'report' || command === 'r') {
commands.report(message, args); commands.report(message, args);
} // [[stats or [[s break;
case 'stats':
case 's':
// [[stats or [[s
// Displays stats on the bot // Displays stats on the bot
else if (command === 'stats' || command === 's') {
commands.stats(message); commands.stats(message);
} // [[api arg break;
case 'api':
// [[api arg
// API sub commands // API sub commands
else if (command === 'api') {
commands.api(message, args); commands.api(message, args);
} // [[roll]] break;
default:
// Non-standard commands
if (command?.startsWith('xdy')) {
// [[xdydz (aka someone copy pasted the template as a roll)
// Help command specifically for the roll command
commands.rollHelp(message);
} else if (command && (`${command}${args.join('')}`).indexOf(config.postfix) > -1) {
// [[roll]]
// Dice rolling commence! // Dice rolling commence!
else if (command && (`${command}${args.join('')}`).indexOf(config.postfix) > -1) {
commands.roll(message, args, command); commands.roll(message, args, command);
} // [[emoji or [[emojialias } else if (command) {
// [[emoji or [[emojialias
// Check if the unhandled command is an emoji request // Check if the unhandled command is an emoji request
else if (command) {
commands.emoji(message, command); commands.emoji(message, command);
} }
break;
}
}, },
}, },
}); });

View File

@ -537,7 +537,7 @@ export const generateApiStatus = (banned: boolean, active: boolean) => {
color: infoColor1, color: infoColor1,
title: `The Artificer's API is ${config.api.enable ? 'currently enabled' : 'currently disabled'}.`, title: `The Artificer's API is ${config.api.enable ? 'currently enabled' : 'currently disabled'}.`,
description: banned ? 'API rolls are banned from being used in this guild.\n\nThis will not be reversed.' : `API rolls are ${apiStatus} in this guild.`, description: banned ? 'API rolls are banned from being used in this guild.\n\nThis will not be reversed.' : `API rolls are ${apiStatus} in this guild.`,
}] }],
}; };
}; };