diff --git a/mod.ts b/mod.ts index 1808a4f..f3146e0 100644 --- a/mod.ts +++ b/mod.ts @@ -276,8 +276,8 @@ startBot({ commands.version(message); break; case 'report': - case 'r': - // [[report or [[r (command that failed) + case 're': + // [[report or [[re (command that failed) // Manually report a failed roll commands.report(message, args); break; @@ -303,6 +303,10 @@ startBot({ // Audit sub commands commands.heatmap(message); break; + case 'roll': + case 'r': + commands.roll(message, args, args.join('')); + break; default: // Non-standard commands if (command?.startsWith('xdy')) { diff --git a/src/commands/roll.ts b/src/commands/roll.ts index 1c3f009..6aa23bd 100644 --- a/src/commands/roll.ts +++ b/src/commands/roll.ts @@ -59,10 +59,18 @@ export const roll = async (message: DiscordenoMessage, args: string[], command: 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({ apiRoll: false, dd: { myResponse: m, originalMessage: message }, - rollCmd: message.content, + rollCmd, modifiers, originalCommand, });