diff --git a/deno.json b/deno.json index 5e98e24..78ac82a 100644 --- a/deno.json +++ b/deno.json @@ -31,9 +31,10 @@ "~flags": "./flags.ts", "artigen/": "./src/artigen/", "commands/": "./src/commands/", + "db/": "./src/db/", "embeds/": "./src/embeds/", "endpoints/": "./src/endpoints/", - "db/": "./src/db/", - "src/": "./src/" + "utils/": "./src/utils/", + "src/api.ts": "./src/api.ts" } } \ No newline at end of file diff --git a/mod.ts b/mod.ts index 909b5ce..2a7bd0d 100644 --- a/mod.ts +++ b/mod.ts @@ -3,7 +3,18 @@ * * December 21, 2020 */ -import { botId, cache, DiscordActivityTypes, DiscordenoGuild, DiscordenoMessage, editBotNickname, editBotStatus, Intents, sendMessage, startBot } from '@discordeno'; +import { + botId, + cache, + DiscordActivityTypes, + DiscordenoGuild, + DiscordenoMessage, + editBotNickname, + editBotStatus, + Intents, + sendMessage, + startBot, +} from '@discordeno'; import { initLog, log, LogTypes as LT } from '@Log4Deno'; import config from '~config'; @@ -17,8 +28,9 @@ import { ignoreList } from 'db/common.ts'; import { successColor, warnColor } from 'embeds/colors.ts'; import api from 'src/api.ts'; -import intervals from 'src/intervals.ts'; -import utils from 'src/utils.ts'; + +import intervals from 'utils/intervals.ts'; +import utils from 'utils/utils.ts'; // Extend the BigInt prototype to support JSON.stringify interface BigIntX extends BigInt { @@ -71,10 +83,12 @@ startBot({ }, 30000); // Interval to update bot list stats every 24 hours - LOCALMODE ? log(LT.INFO, 'updateListStatistics not running') : setInterval(() => { - log(LT.LOG, 'Updating all bot lists statistics'); - intervals.updateListStatistics(botId, cache.guilds.size + cache.dispatchedGuildIds.size); - }, 86400000); + LOCALMODE + ? log(LT.INFO, 'updateListStatistics not running') + : setInterval(() => { + log(LT.LOG, 'Updating all bot lists statistics'); + intervals.updateListStatistics(botId, cache.guilds.size + cache.dispatchedGuildIds.size); + }, 86400000); // Interval to update hourlyRates every hour setInterval(() => { diff --git a/src/artigen/managers/handler/workerComplete.ts b/src/artigen/managers/handler/workerComplete.ts index 45b2e91..f6b9bc5 100644 --- a/src/artigen/managers/handler/workerComplete.ts +++ b/src/artigen/managers/handler/workerComplete.ts @@ -18,7 +18,7 @@ import { generateCountDetailsEmbed, generateDMFailed, generateRollEmbed } from ' import stdResp from 'endpoints/stdResponses.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const onWorkerComplete = async (workerMessage: MessageEvent, workerTimeout: number, rollRequest: QueuedRoll) => { let apiErroredOut = false; @@ -32,7 +32,7 @@ export const onWorkerComplete = async (workerMessage: MessageEvent, const pubEmbedDetails = await generateRollEmbed( rollRequest.apiRoll ? rollRequest.api.userId : rollRequest.dd.originalMessage.authorId, returnMsg, - rollRequest.modifiers, + rollRequest.modifiers ); const gmEmbedDetails = await generateRollEmbed(rollRequest.apiRoll ? rollRequest.api.userId : rollRequest.dd.originalMessage.authorId, returnMsg, { ...rollRequest.modifiers, @@ -143,14 +143,14 @@ export const onWorkerComplete = async (workerMessage: MessageEvent, JSON.stringify( rollRequest.modifiers.count ? { - counts: countEmbed, - details: pubEmbedDetails, - } + counts: countEmbed, + details: pubEmbedDetails, + } : { - details: pubEmbedDetails, - }, - ), - ), + details: pubEmbedDetails, + } + ) + ) ); } } diff --git a/src/artigen/managers/handler/workerTerminate.ts b/src/artigen/managers/handler/workerTerminate.ts index e09a476..bf2fe4e 100644 --- a/src/artigen/managers/handler/workerTerminate.ts +++ b/src/artigen/managers/handler/workerTerminate.ts @@ -9,7 +9,7 @@ import { generateRollEmbed } from 'embeds/artigen.ts'; import stdResp from 'endpoints/stdResponses.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const terminateWorker = async (rollWorker: Worker, rollRequest: QueuedRoll) => { rollWorker.terminate(); @@ -24,12 +24,12 @@ export const terminateWorker = async (rollWorker: Worker, rollRequest: QueuedRol ( await generateRollEmbed( rollRequest.dd.originalMessage.authorId, - { + { error: true, errorCode: 'TooComplex', errorMsg: 'Error: Roll took too long to process, try breaking roll down into simpler parts', }, - {}, + {} ) ).embed, ], diff --git a/src/artigen/managers/queueManager.ts b/src/artigen/managers/queueManager.ts index fbbbc78..23c1640 100644 --- a/src/artigen/managers/queueManager.ts +++ b/src/artigen/managers/queueManager.ts @@ -9,7 +9,7 @@ import { handleRollRequest } from 'artigen/managers/workerManager.ts'; import { rollingEmbed } from 'embeds/artigen.ts'; import { infoColor2 } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; const rollQueue: Array = []; @@ -41,7 +41,9 @@ The results for this roll will replace this message when it is done.`, setInterval(() => { log( LT.LOG, - `Checking rollQueue for items, rollQueue length: ${rollQueue.length}, currentWorkers: ${getWorkerCnt()}, config.limits.maxWorkers: ${config.limits.maxWorkers}`, + `Checking rollQueue for items, rollQueue length: ${rollQueue.length}, currentWorkers: ${getWorkerCnt()}, config.limits.maxWorkers: ${ + config.limits.maxWorkers + }` ); if (rollQueue.length && getWorkerCnt() < config.limits.maxWorkers) { const rollRequest = rollQueue.shift(); diff --git a/src/commands/apiCmd.ts b/src/commands/apiCmd.ts index 941b92b..1fed39f 100644 --- a/src/commands/apiCmd.ts +++ b/src/commands/apiCmd.ts @@ -9,7 +9,7 @@ import { queries } from 'db/common.ts'; import { failColor } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const api = async (message: DiscordenoMessage, args: string[]) => { // Light telemetry to see how many times a command is being run diff --git a/src/commands/apiCmd/allowBlock.ts b/src/commands/apiCmd/allowBlock.ts index 8b4f26f..9aa7d13 100644 --- a/src/commands/apiCmd/allowBlock.ts +++ b/src/commands/apiCmd/allowBlock.ts @@ -4,7 +4,7 @@ import dbClient from 'db/client.ts'; import { generateApiFailed, generateApiSuccess } from 'embeds/api.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const allowBlock = async (message: DiscordenoMessage, apiArg: string) => { let errorOutInitial = false; diff --git a/src/commands/apiCmd/apiHelp.ts b/src/commands/apiCmd/apiHelp.ts index bc04d6c..205e55a 100644 --- a/src/commands/apiCmd/apiHelp.ts +++ b/src/commands/apiCmd/apiHelp.ts @@ -4,7 +4,7 @@ import config from '~config'; import { infoColor1, infoColor2 } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const help = (message: DiscordenoMessage) => { message @@ -13,8 +13,7 @@ export const help = (message: DiscordenoMessage) => { { color: infoColor2, title: `${config.name}'s API Details:`, - description: - `${config.name} has a built in API that allows user to roll dice into Discord using third party programs. By default, API rolls are blocked from being sent in your guild. The API warning is also enabled by default. These commands may only be used by the Owner or Admins of your guild. + description: `${config.name} has a built in API that allows user to roll dice into Discord using third party programs. By default, API rolls are blocked from being sent in your guild. The API warning is also enabled by default. These commands may only be used by the Owner or Admins of your guild. For information on how to use the API, please check the GitHub README for more information [here](${config.links.sourceCode}). diff --git a/src/commands/apiCmd/deleteGuild.ts b/src/commands/apiCmd/deleteGuild.ts index 8f438e1..a62bf1a 100644 --- a/src/commands/apiCmd/deleteGuild.ts +++ b/src/commands/apiCmd/deleteGuild.ts @@ -6,7 +6,7 @@ import dbClient from 'db/client.ts'; import { failColor, successColor } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const deleteGuild = async (message: DiscordenoMessage) => { let errorOut = false; diff --git a/src/commands/apiCmd/showHideWarn.ts b/src/commands/apiCmd/showHideWarn.ts index cc33435..36ba093 100644 --- a/src/commands/apiCmd/showHideWarn.ts +++ b/src/commands/apiCmd/showHideWarn.ts @@ -4,7 +4,7 @@ import dbClient from 'db/client.ts'; import { generateApiFailed, generateApiSuccess } from 'embeds/api.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const showHideWarn = async (message: DiscordenoMessage, apiArg: string) => { let errorOutInitial = false; diff --git a/src/commands/apiCmd/status.ts b/src/commands/apiCmd/status.ts index c059624..151a970 100644 --- a/src/commands/apiCmd/status.ts +++ b/src/commands/apiCmd/status.ts @@ -5,7 +5,7 @@ import dbClient from 'db/client.ts'; import { generateApiStatus } from 'embeds/api.ts'; import { failColor } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const status = async (message: DiscordenoMessage) => { // Get status of guild from the db diff --git a/src/commands/audit.ts b/src/commands/audit.ts index 87f9b78..d09718f 100644 --- a/src/commands/audit.ts +++ b/src/commands/audit.ts @@ -9,7 +9,7 @@ import { queries } from 'db/common.ts'; import { failColor } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const audit = (message: DiscordenoMessage, args: string[]) => { // Light telemetry to see how many times a command is being run diff --git a/src/commands/auditCmd/auditDB.ts b/src/commands/auditCmd/auditDB.ts index c5038f8..53cfe74 100644 --- a/src/commands/auditCmd/auditDB.ts +++ b/src/commands/auditCmd/auditDB.ts @@ -5,7 +5,7 @@ import dbClient from 'db/client.ts'; import { infoColor2 } from 'embeds/colors.ts'; import { compilingStats } from 'embeds/common.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; interface DBSizeData { table: string; diff --git a/src/commands/auditCmd/auditGuilds.ts b/src/commands/auditCmd/auditGuilds.ts index 1b1fd7a..a543da9 100644 --- a/src/commands/auditCmd/auditGuilds.ts +++ b/src/commands/auditCmd/auditGuilds.ts @@ -4,7 +4,7 @@ import config from '~config'; import { infoColor2 } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; const sortGuildByMemberCount = (a: DiscordenoGuild, b: DiscordenoGuild) => { if (a.memberCount < b.memberCount) { @@ -120,21 +120,25 @@ Please see attached file for audit details on cached guilds and members.`, }, { name: 'Repeat Guild Owners:', - value: repeatCounts - .map((ownerCnt, serverIdx) => `${ownerCnt} ${ownerCnt === 1 ? 'person has' : 'people have'} me in ${serverIdx + 1} of their guilds`) - .filter((str) => str) - .join('\n') || 'No Repeat Guild Owners', + value: + repeatCounts + .map((ownerCnt, serverIdx) => `${ownerCnt} ${ownerCnt === 1 ? 'person has' : 'people have'} me in ${serverIdx + 1} of their guilds`) + .filter((str) => str) + .join('\n') || 'No Repeat Guild Owners', }, { name: 'Guild Size Dist:', - value: Array.from(guildSizeDist) - .map( - ([size, count], idx) => - `${count} Guild${count === 1 ? ' has' : 's have'} ${ - guildSizeDist.has(sizeCats[idx - 1]) ? `${size.toLocaleString()} - ${(sizeCats[idx - 1] - 1).toLocaleString()}` : `at least ${size.toLocaleString()}` - } Member${size === 1 ? '' : 's'}`, - ) - .join('\n') || 'Not available', + value: + Array.from(guildSizeDist) + .map( + ([size, count], idx) => + `${count} Guild${count === 1 ? ' has' : 's have'} ${ + guildSizeDist.has(sizeCats[idx - 1]) + ? `${size.toLocaleString()} - ${(sizeCats[idx - 1] - 1).toLocaleString()}` + : `at least ${size.toLocaleString()}` + } Member${size === 1 ? '' : 's'}` + ) + .join('\n') || 'Not available', }, ], }, diff --git a/src/commands/auditCmd/auditHelp.ts b/src/commands/auditCmd/auditHelp.ts index 4e6d0c4..8a534d3 100644 --- a/src/commands/auditCmd/auditHelp.ts +++ b/src/commands/auditCmd/auditHelp.ts @@ -4,7 +4,7 @@ import config from '~config'; import { infoColor1 } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const auditHelp = (message: DiscordenoMessage) => { message diff --git a/src/commands/emoji.ts b/src/commands/emoji.ts index 864867d..53816dd 100644 --- a/src/commands/emoji.ts +++ b/src/commands/emoji.ts @@ -6,7 +6,7 @@ import config from '~config'; import dbClient from 'db/client.ts'; import { queries } from 'db/common.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; interface EmojiConf { name: string; diff --git a/src/commands/handleMentions.ts b/src/commands/handleMentions.ts index c82ce58..bdaf5a6 100644 --- a/src/commands/handleMentions.ts +++ b/src/commands/handleMentions.ts @@ -8,7 +8,7 @@ import { queries } from 'db/common.ts'; import { infoColor1 } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const handleMentions = (message: DiscordenoMessage) => { log(LT.LOG, `Handling @mention message: ${JSON.stringify(message)}`); diff --git a/src/commands/heatmap.ts b/src/commands/heatmap.ts index 1e6c804..4dbe817 100644 --- a/src/commands/heatmap.ts +++ b/src/commands/heatmap.ts @@ -8,7 +8,7 @@ import { queries } from 'db/common.ts'; import { failColor, infoColor2 } from 'embeds/colors.ts'; import intervals from 'src/intervals.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const heatmap = (message: DiscordenoMessage) => { // Light telemetry to see how many times a command is being run diff --git a/src/commands/help.ts b/src/commands/help.ts index 845042b..758909f 100644 --- a/src/commands/help.ts +++ b/src/commands/help.ts @@ -7,7 +7,7 @@ import { queries } from 'db/common.ts'; import { infoColor2 } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const help = (message: DiscordenoMessage) => { // Light telemetry to see how many times a command is being run @@ -92,8 +92,7 @@ export const help = (message: DiscordenoMessage) => { }, { 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}\`), run \`${config.prefix}??\` for more details`, + 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}\`), run \`${config.prefix}??\` for more details`, inline: true, }, ], diff --git a/src/commands/info.ts b/src/commands/info.ts index 6183cd2..8663a5b 100644 --- a/src/commands/info.ts +++ b/src/commands/info.ts @@ -7,7 +7,7 @@ import { queries } from 'db/common.ts'; import { infoColor2 } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const info = (message: DiscordenoMessage) => { // Light telemetry to see how many times a command is being run diff --git a/src/commands/optIn.ts b/src/commands/optIn.ts index bc9e47c..9b9992a 100644 --- a/src/commands/optIn.ts +++ b/src/commands/optIn.ts @@ -7,7 +7,7 @@ import { ignoreList, queries } from 'db/common.ts'; import { failColor, successColor } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const optIn = async (message: DiscordenoMessage) => { // Light telemetry to see how many times a command is being run diff --git a/src/commands/optOut.ts b/src/commands/optOut.ts index 00b9266..78508d3 100644 --- a/src/commands/optOut.ts +++ b/src/commands/optOut.ts @@ -7,7 +7,7 @@ import { ignoreList, queries } from 'db/common.ts'; import { failColor, successColor } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const optOut = async (message: DiscordenoMessage) => { // Light telemetry to see how many times a command is being run diff --git a/src/commands/ping.ts b/src/commands/ping.ts index 164ab3a..4c42e9c 100644 --- a/src/commands/ping.ts +++ b/src/commands/ping.ts @@ -5,7 +5,7 @@ import { queries } from 'db/common.ts'; import { infoColor1 } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; const generatePing = (time: number) => ({ embeds: [ diff --git a/src/commands/privacy.ts b/src/commands/privacy.ts index d82da90..c4140d4 100644 --- a/src/commands/privacy.ts +++ b/src/commands/privacy.ts @@ -7,7 +7,7 @@ import { queries } from 'db/common.ts'; import { infoColor1 } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const privacy = (message: DiscordenoMessage) => { // Light telemetry to see how many times a command is being run @@ -22,8 +22,7 @@ export const privacy = (message: DiscordenoMessage) => { fields: [ { name: `${config.name} does not track or collect user information via Discord.`, - value: - `The only user submitted information that is stored is submitted via the \`${config.prefix}report\` command. This information is only stored for a short period of time in a location that only the Developer of ${config.name} can see. + value: `The only user submitted information that is stored is submitted via the \`${config.prefix}report\` command. This information is only stored for a short period of time in a location that only the Developer of ${config.name} can see. For more details, please check out the Privacy Policy on the GitHub [here](${config.links.privacyPolicy}). diff --git a/src/commands/report.ts b/src/commands/report.ts index 8f0d6e0..18af181 100644 --- a/src/commands/report.ts +++ b/src/commands/report.ts @@ -6,7 +6,7 @@ import dbClient from 'db/client.ts'; import { queries } from 'db/common.ts'; import { failColor, infoColor2, successColor } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const report = (message: DiscordenoMessage, args: string[]) => { // Light telemetry to see how many times a command is being run diff --git a/src/commands/rip.ts b/src/commands/rip.ts index 6dfd63a..e0d69a0 100644 --- a/src/commands/rip.ts +++ b/src/commands/rip.ts @@ -7,7 +7,7 @@ import { queries } from 'db/common.ts'; import { infoColor2 } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const rip = (message: DiscordenoMessage) => { // Light telemetry to see how many times a command is being run diff --git a/src/commands/roll.ts b/src/commands/roll.ts index fc041f0..1d9aca2 100644 --- a/src/commands/roll.ts +++ b/src/commands/roll.ts @@ -14,7 +14,7 @@ import { queries } from 'db/common.ts'; import { generateRollError, rollingEmbed } from 'embeds/artigen.ts'; import { warnColor } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.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 +48,9 @@ export const roll = async (message: DiscordenoMessage, args: string[], command: // Return early if the modifiers were invalid if (!modifiers.valid) { - m.edit(generateRollError('Modifiers invalid:', modifiers.error.name, modifiers.error.message)).catch((e) => utils.commonLoggers.messageEditError('roll.ts:50', m, e)); + m.edit(generateRollError('Modifiers invalid:', modifiers.error.name, modifiers.error.message)).catch((e) => + utils.commonLoggers.messageEditError('roll.ts:50', m, e) + ); if (DEVMODE && config.logRolls) { // If enabled, log rolls so we can verify the bots math diff --git a/src/commands/rollDecorators.ts b/src/commands/rollDecorators.ts index 3e1ecc8..60e2d16 100644 --- a/src/commands/rollDecorators.ts +++ b/src/commands/rollDecorators.ts @@ -7,7 +7,7 @@ import { queries } from 'db/common.ts'; import { infoColor2 } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const rollDecorators = (message: DiscordenoMessage) => { // Light telemetry to see how many times a command is being run @@ -55,7 +55,8 @@ Examples: \`${config.prefix}d20${config.postfix} -nd\`, \`${config.prefix}d20${c }, { name: '`-gm @user1 @user2 @userN` - GM Roll', - value: 'Rolls the requested roll in GM mode, suppressing all publicly shown results and details and sending the results directly to the specified GMs', + value: + 'Rolls the requested roll in GM mode, suppressing all publicly shown results and details and sending the results directly to the specified GMs', inline: true, }, { diff --git a/src/commands/rollHelp.ts b/src/commands/rollHelp.ts index bbe2dce..0f0e2df 100644 --- a/src/commands/rollHelp.ts +++ b/src/commands/rollHelp.ts @@ -7,7 +7,7 @@ import { queries } from 'db/common.ts'; import { infoColor1, infoColor2, successColor } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const rollHelp = (message: DiscordenoMessage) => { // Light telemetry to see how many times a command is being run @@ -73,27 +73,32 @@ Additionally, replace \`x\` with \`F\` to roll Fate dice`, }, { 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`', + 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`', + 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`', + 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, }, { @@ -188,27 +193,32 @@ Additionally, replace \`x\` with \`F\` to roll Fate dice`, }, { name: '`!p>u` [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', + 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', + 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: '`!! { // Light telemetry to see how many times a command is being run diff --git a/src/commands/version.ts b/src/commands/version.ts index c0f8d6c..cfe9858 100644 --- a/src/commands/version.ts +++ b/src/commands/version.ts @@ -7,7 +7,7 @@ import { queries } from 'db/common.ts'; import { infoColor1 } from 'embeds/colors.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const version = (message: DiscordenoMessage) => { // Light telemetry to see how many times a command is being run diff --git a/src/endpoints/deletes/apiKeyDelete.ts b/src/endpoints/deletes/apiKeyDelete.ts index 1a25e18..bba5ee7 100644 --- a/src/endpoints/deletes/apiKeyDelete.ts +++ b/src/endpoints/deletes/apiKeyDelete.ts @@ -10,7 +10,7 @@ import { verifyQueryHasParams } from 'endpoints/utils.ts'; import { generateApiDeleteEmail } from 'embeds/api.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const apiKeyDelete = async (query: Map, apiUserid: bigint, apiUserEmail: string, apiUserDelCode: string): Promise => { if (verifyQueryHasParams(query, ['user', 'email'])) { diff --git a/src/endpoints/gets/apiChannel.ts b/src/endpoints/gets/apiChannel.ts index 746a542..aa9361c 100644 --- a/src/endpoints/gets/apiChannel.ts +++ b/src/endpoints/gets/apiChannel.ts @@ -3,7 +3,7 @@ import dbClient from 'db/client.ts'; import stdResp from 'endpoints/stdResponses.ts'; import { verifyQueryHasParams } from 'endpoints/utils.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const apiChannel = async (query: Map, apiUserid: bigint): Promise => { if (verifyQueryHasParams(query, ['user'])) { diff --git a/src/endpoints/gets/apiKey.ts b/src/endpoints/gets/apiKey.ts index 821c928..f837e4b 100644 --- a/src/endpoints/gets/apiKey.ts +++ b/src/endpoints/gets/apiKey.ts @@ -10,7 +10,7 @@ import { verifyQueryHasParams } from 'endpoints/utils.ts'; import { generateApiKeyEmail } from 'embeds/api.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const apiKey = async (query: Map): Promise => { if (verifyQueryHasParams(query, ['user', 'email'])) { diff --git a/src/endpoints/gets/apiKeyAdmin.ts b/src/endpoints/gets/apiKeyAdmin.ts index 1e1be96..c9e0991 100644 --- a/src/endpoints/gets/apiKeyAdmin.ts +++ b/src/endpoints/gets/apiKeyAdmin.ts @@ -7,7 +7,7 @@ import dbClient from 'db/client.ts'; import stdResp from 'endpoints/stdResponses.ts'; import { verifyQueryHasParams } from 'endpoints/utils.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const apiKeyAdmin = async (query: Map, apiUserid: bigint): Promise => { if (verifyQueryHasParams(query, ['user', 'a'])) { diff --git a/src/endpoints/gets/apiRoll.ts b/src/endpoints/gets/apiRoll.ts index bd3e9fe..6fa00d4 100644 --- a/src/endpoints/gets/apiRoll.ts +++ b/src/endpoints/gets/apiRoll.ts @@ -13,7 +13,7 @@ import { queries } from 'db/common.ts'; import stdResp from 'endpoints/stdResponses.ts'; import { verifyQueryHasParams } from 'endpoints/utils.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; const apiWarning = `The following roll was conducted using my built in API. If someone in this channel did not request this roll, please report API abuse here: <${config.api.supportURL}>`; @@ -116,7 +116,7 @@ export const apiRoll = async (query: Map, apiUserid: bigint): Pr } else { // Alert API user that they messed up return stdResp.Forbidden( - `Verify you are a member of the guild you are sending this roll to. If you are, the ${config.name} may not have that registered, please send a message in the guild so ${config.name} can register this. This registration is temporary, so if you see this error again, just poke your server again.`, + `Verify you are a member of the guild you are sending this roll to. If you are, the ${config.name} may not have that registered, please send a message in the guild so ${config.name} can register this. This registration is temporary, so if you see this error again, just poke your server again.` ); } } else { diff --git a/src/endpoints/posts/apiChannelAdd.ts b/src/endpoints/posts/apiChannelAdd.ts index efef186..13e4f36 100644 --- a/src/endpoints/posts/apiChannelAdd.ts +++ b/src/endpoints/posts/apiChannelAdd.ts @@ -3,7 +3,7 @@ import dbClient from 'db/client.ts'; import stdResp from 'endpoints/stdResponses.ts'; import { verifyQueryHasParams } from 'endpoints/utils.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const apiChannelAdd = async (query: Map, apiUserid: bigint): Promise => { if (verifyQueryHasParams(query, ['user', 'channel'])) { diff --git a/src/endpoints/puts/apiChannelManageActive.ts b/src/endpoints/puts/apiChannelManageActive.ts index 6d347d5..774d2a2 100644 --- a/src/endpoints/puts/apiChannelManageActive.ts +++ b/src/endpoints/puts/apiChannelManageActive.ts @@ -3,7 +3,7 @@ import dbClient from 'db/client.ts'; import stdResp from 'endpoints/stdResponses.ts'; import { verifyQueryHasParams } from 'endpoints/utils.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const apiChannelManageActive = async (query: Map, apiUserid: bigint, path: string): Promise => { if (verifyQueryHasParams(query, ['user', 'channel'])) { diff --git a/src/endpoints/puts/apiChannelManageBan.ts b/src/endpoints/puts/apiChannelManageBan.ts index 75088d8..46f89b6 100644 --- a/src/endpoints/puts/apiChannelManageBan.ts +++ b/src/endpoints/puts/apiChannelManageBan.ts @@ -5,7 +5,7 @@ import dbClient from 'db/client.ts'; import stdResp from 'endpoints/stdResponses.ts'; import { verifyQueryHasParams } from 'endpoints/utils.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const apiChannelManageBan = async (query: Map, apiUserid: bigint, path: string): Promise => { if (verifyQueryHasParams(query, ['user', 'channel', 'a'])) { diff --git a/src/endpoints/puts/apiKeyManage.ts b/src/endpoints/puts/apiKeyManage.ts index 6f8a3c6..a3c2e75 100644 --- a/src/endpoints/puts/apiKeyManage.ts +++ b/src/endpoints/puts/apiKeyManage.ts @@ -5,7 +5,7 @@ import dbClient from 'db/client.ts'; import stdResp from 'endpoints/stdResponses.ts'; import { verifyQueryHasParams } from 'endpoints/utils.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; export const apiKeyManage = async (query: Map, apiUserid: bigint, path: string): Promise => { if (verifyQueryHasParams(query, ['user', 'a'])) { diff --git a/src/intervals.ts b/src/utils/intervals.ts similarity index 99% rename from src/intervals.ts rename to src/utils/intervals.ts index f639a62..1032910 100644 --- a/src/intervals.ts +++ b/src/utils/intervals.ts @@ -12,7 +12,7 @@ import config from '~config'; import dbClient from 'db/client.ts'; import { weekDays } from 'db/common.ts'; -import utils from 'src/utils.ts'; +import utils from 'utils/utils.ts'; interface PastCommandCount { command: string; diff --git a/src/utils.ts b/src/utils/utils.ts similarity index 100% rename from src/utils.ts rename to src/utils/utils.ts