import { DiscordenoMessage } from '@discordeno'; import config from '~config'; import dbClient from 'db/client.ts'; import { queries } from 'db/common.ts'; import { infoColor1, infoColor2, successColor } from 'embeds/colors.ts'; import utils from 'src/utils.ts'; export const rollHelp = (message: DiscordenoMessage) => { // Light telemetry to see how many times a command is being run dbClient.execute(queries.callIncCnt('rollhelp')).catch((e) => utils.commonLoggers.dbError('rollHelp.ts:15', 'call sproc INC_CNT on', e)); message .send({ embeds: [ { color: infoColor1, title: `${config.name}'s Roll Command Details:`, description: `You can chain as many of these options as you want, as long as the option does not disallow it. This command also can fully solve math equations with parenthesis. ${config.name} supports most of the [Roll20 formatting](${config.links.roll20Formatting}). More details and examples can be found [here](${config.links.roll20Formatting}). Run \`[[???\` or \`[[rollDecorators\` for details on the roll decorators.`, }, { color: infoColor2, title: 'Roll20 Dice Options:', fields: [ { name: `\`${config.prefix}xdydzracsq!${config.postfix}\` ...`, value: `Rolls all configs requested, you may repeat the command multiple times in the same message (just ensure you close each roll with \`${config.postfix}\`)`, }, { name: '`x` [Optional]', value: `Number of dice to roll, if omitted, 1 is used Additionally, replace \`x\` with \`F\` to roll Fate dice`, inline: true, }, { name: '`dy` [Required]', value: 'Size of dice to roll, `d20` = 20 sided die', inline: true, }, { name: '`dz` or `dlz` [Optional]', value: 'Drops the lowest `z` dice, cannot be used with `kz`', inline: true, }, { name: '`kz` or `khz` [Optional]', value: 'Keeps the highest `z` dice, cannot be used with `dz`', inline: true, }, { name: '`dhz` [Optional]', value: 'Drops the highest `z` dice, cannot be used with `kz`', inline: true, }, { name: '`klz` [Optional]', value: 'Keeps the lowest `z` dice, cannot be used with `dz`', inline: true, }, { name: '`ra` or `r=q` [Optional]', value: 'Rerolls any rolls that match `a`, `r3` will reroll every die that land on 3, throwing out old rolls, cannot be used with `ro`', inline: true, }, { name: '`rq` [Optional]', value: 'Rerolls any rolls that are greater than or equal to `a`, `r3` will reroll every die that land on 3 or greater, throwing out old rolls, cannot be used with `ro`', inline: true, }, { name: '`roa` or `ro=q` [Optional]', value: 'Rerolls any rolls that match `a`, `ro3` will reroll each die that lands on 3 ONLY ONE TIME, throwing out old rolls, cannot be used with `r`', inline: true, }, { name: '`roq` [Optional]', value: 'Rerolls any rolls that are greater than or equal to `a`, `ro3` will reroll each die that lands on 3 or greater ONLY ONE TIME, throwing out old rolls, cannot be used with `r`', inline: true, }, { name: '`csq` or `cs=q` [Optional]', value: 'Changes crit score to `q`', inline: true, }, { name: '`csq` [Optional]', value: 'Changes crit score to be greater than or equal to `q`', inline: true, }, { name: '`cfq` or `cf=q` [Optional]', value: 'Changes crit fail to `q`', inline: true, }, { name: '`cfq` [Optional]', value: 'Changes crit fail to be greater than or equal to `q`', inline: true, }, { name: '`!` [Optional]', value: 'Exploding, rolls another `dy` for every crit success', inline: true, }, { name: '`!o` [Optional]', value: 'Exploding Once, rolls one `dy` for each original crit success', inline: true, }, { name: '`!p` [Optional]', value: 'Penetrating Explosion, rolls one `dy` for each crit success, but subtracts one from each resulting explosion', inline: true, }, { name: '`!!` [Optional]', value: 'Compounding Explosion, rolls one `dy` for each crit success, but adds the resulting explosion to the die that caused this explosion', inline: true, }, { name: '`!=u` [Optional]', value: 'Explode on `u`, rolls another `dy` for every die that lands on `u`', inline: true, }, { name: '`!>u` [Optional]', value: 'Explode on `u` and greater, rolls another `dy` for every die that lands on `u` or greater', inline: true, }, ], }, { color: infoColor2, fields: [ { name: '`!u` [Optional]', value: 'Explode Once on `u` and greater, rolls another `dy` for each original die that landed on `u` or greater', inline: true, }, { name: '`!ou` [Optional]', value: 'Penetrating Explosion on `u` and greater, rolls one `dy` for each die that lands on `u` or greater, but subtracts one from each resulting explosion', inline: true, }, { name: '`!pu` [Optional]', value: 'Compounding Explosion on `u` and greater, rolls one `dy` for each die that lands on `u` or greater, but adds the resulting explosion to the die that caused this explosion', inline: true, }, { name: '`!! utils.commonLoggers.messageSendError('rollHelp.ts:247', message, e)); };