1
1
mirror of https://github.com/Burn-E99/TheArtificer.git synced 2026-06-04 09:03:50 -04:00

Preparing rollQueue to handle api Rolls

This commit is contained in:
Ean Milligan (Bastion)
2022-06-20 19:18:23 -04:00
parent 170c089fe9
commit a0dae3416f
3 changed files with 49 additions and 31 deletions

View File

@@ -11,6 +11,7 @@ import {
import { rollingEmbed, warnColor } from '../commandUtils.ts';
import rollFuncs from './roll/_index.ts';
import { queueRoll } from '../solver/rollQueue.ts';
import { QueuedRoll } from '../mod.d.ts';
export const roll = async (message: DiscordenoMessage, args: string[], command: string) => {
// Light telemetry to see how many times a command is being run
@@ -48,7 +49,14 @@ export const roll = async (message: DiscordenoMessage, args: string[], command:
// Rejoin all of the args and send it into the solver, if solver returns a falsy item, an error object will be substituded in
const rollCmd = `${command} ${args.join(' ')}`;
queueRoll(m, message, originalCommand, rollCmd, modifiers);
queueRoll(
<QueuedRoll> {
apiRoll: false,
dd: { m, message, originalCommand },
rollCmd,
modifiers,
},
);
} catch (e) {
log(LT.ERROR, `Undandled Error: ${JSON.stringify(e)}`);
}