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

update api roll to use resolve instead of old respondWith

This commit is contained in:
Ean Milligan
2025-04-26 16:42:44 -04:00
parent 5e14b4207e
commit dff1e97186
3 changed files with 20 additions and 16 deletions

View File

@@ -94,14 +94,17 @@ export const apiRoll = async (query: Map<string, string>, apiUserid: bigint): Pr
apiWarn: hideWarn ? '' : apiWarning,
};
// Parse the roll and get the return text
await queueRoll({
apiRoll: true,
api: { channelId: BigInt(query.get('channel') || '0'), userId: BigInt(query.get('user') || '') },
rollCmd,
modifiers,
originalCommand,
return new Promise<Response>((resolve) => {
queueRoll({
apiRoll: true,
api: { resolve, channelId: BigInt(query.get('channel') || '0'), userId: BigInt(query.get('user') || '') },
rollCmd,
modifiers,
originalCommand,
});
});
// Parse the roll and get the return text
} catch (err) {
// Handle any errors we missed
log(LT.ERROR, `Unhandled Error: ${JSON.stringify(err)}`);