removed [[r shorthand from report command, add [[r and [[roll as aliases to the roll command

This commit is contained in:
Ean Milligan 2025-05-03 22:02:15 -04:00
parent fafaee67b3
commit 0b864b0f21
2 changed files with 15 additions and 3 deletions

8
mod.ts
View File

@ -276,8 +276,8 @@ startBot({
commands.version(message); commands.version(message);
break; break;
case 'report': case 'report':
case 'r': case 're':
// [[report or [[r (command that failed) // [[report or [[re (command that failed)
// Manually report a failed roll // Manually report a failed roll
commands.report(message, args); commands.report(message, args);
break; break;
@ -303,6 +303,10 @@ startBot({
// Audit sub commands // Audit sub commands
commands.heatmap(message); commands.heatmap(message);
break; break;
case 'roll':
case 'r':
commands.roll(message, args, args.join(''));
break;
default: default:
// Non-standard commands // Non-standard commands
if (command?.startsWith('xdy')) { if (command?.startsWith('xdy')) {

View File

@ -59,10 +59,18 @@ export const roll = async (message: DiscordenoMessage, args: string[], command:
return; return;
} }
let rollCmd = message.content.startsWith(`${config.prefix}r`) ? args.join(' ') : message.content;
if (!rollCmd.includes(config.prefix)) {
rollCmd = `${config.prefix}${rollCmd}`;
}
if (!rollCmd.includes(config.postfix)) {
rollCmd = `${rollCmd}${config.postfix}`;
}
sendRollRequest({ sendRollRequest({
apiRoll: false, apiRoll: false,
dd: { myResponse: m, originalMessage: message }, dd: { myResponse: m, originalMessage: message },
rollCmd: message.content, rollCmd,
modifiers, modifiers,
originalCommand, originalCommand,
}); });