move utils around
This commit is contained in:
parent
3e6844ed10
commit
9a5574f91e
|
@ -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"
|
||||
}
|
||||
}
|
22
mod.ts
22
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,7 +83,9 @@ startBot({
|
|||
}, 30000);
|
||||
|
||||
// Interval to update bot list stats every 24 hours
|
||||
LOCALMODE ? log(LT.INFO, 'updateListStatistics not running') : setInterval(() => {
|
||||
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);
|
||||
|
|
|
@ -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<SolvedRoll>, workerTimeout: number, rollRequest: QueuedRoll) => {
|
||||
let apiErroredOut = false;
|
||||
|
@ -32,7 +32,7 @@ export const onWorkerComplete = async (workerMessage: MessageEvent<SolvedRoll>,
|
|||
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,
|
||||
|
@ -148,9 +148,9 @@ export const onWorkerComplete = async (workerMessage: MessageEvent<SolvedRoll>,
|
|||
}
|
||||
: {
|
||||
details: pubEmbedDetails,
|
||||
},
|
||||
),
|
||||
),
|
||||
}
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
<SolvedRoll> {
|
||||
<SolvedRoll>{
|
||||
error: true,
|
||||
errorCode: 'TooComplex',
|
||||
errorMsg: 'Error: Roll took too long to process, try breaking roll down into simpler parts',
|
||||
},
|
||||
<RollModifiers> {},
|
||||
<RollModifiers>{}
|
||||
)
|
||||
).embed,
|
||||
],
|
||||
|
|
|
@ -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<QueuedRoll> = [];
|
||||
|
||||
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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}).
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,19 +120,23 @@ Please see attached file for audit details on cached guilds and members.`,
|
|||
},
|
||||
{
|
||||
name: 'Repeat Guild Owners:',
|
||||
value: repeatCounts
|
||||
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)
|
||||
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'}`,
|
||||
guildSizeDist.has(sizeCats[idx - 1])
|
||||
? `${size.toLocaleString()} - ${(sizeCats[idx - 1] - 1).toLocaleString()}`
|
||||
: `at least ${size.toLocaleString()}`
|
||||
} Member${size === 1 ? '' : 's'}`
|
||||
)
|
||||
.join('\n') || 'Not available',
|
||||
},
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)}`);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
],
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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: [
|
||||
|
|
|
@ -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}).
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
{
|
||||
|
|
|
@ -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: '`r<q` [Optional]',
|
||||
value: 'Rerolls any rolls that are less than or equal to `a`, `r3` will reroll every die that land on 3, 2, or 1, throwing out old rolls, cannot be used with `ro`',
|
||||
value:
|
||||
'Rerolls any rolls that are less than or equal to `a`, `r3` will reroll every die that land on 3, 2, or 1, throwing out old rolls, cannot be used with `ro`',
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
name: '`r>q` [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: '`ro<q` [Optional]',
|
||||
value: 'Rerolls any rolls that are less than or equal to `a`, `ro3` will reroll each die that lands on 3, 2, or 1 ONLY ONE TIME, throwing out old rolls, cannot be used with `r`',
|
||||
value:
|
||||
'Rerolls any rolls that are less than or equal to `a`, `ro3` will reroll each die that lands on 3, 2, or 1 ONLY ONE TIME, throwing out old rolls, cannot be used with `r`',
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
name: '`ro>q` [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: '`!p<u` [Optional]',
|
||||
value: 'Penetrating Explosion on `u` and under, rolls one `dy` for each die that lands on `u` or under, but subtracts one from each resulting explosion',
|
||||
value:
|
||||
'Penetrating Explosion on `u` and under, rolls one `dy` for each die that lands on `u` or under, but subtracts one from each resulting explosion',
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
name: '`!!=u` [Optional]',
|
||||
value: 'Compounding Explosion on `u`, rolls one `dy` for each die that lands on `u`, but adds the resulting explosion to the die that caused this explosion',
|
||||
value:
|
||||
'Compounding Explosion on `u`, rolls one `dy` for each die that lands on `u`, but adds the resulting explosion to the die that caused this explosion',
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
name: '`!!>u` [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: '`!!<u` [Optional]',
|
||||
value: 'Compounding Explosion on `u` and under, rolls one `dy` for each die that lands on `u` or under, but adds the resulting explosion to the die that caused this explosion',
|
||||
value:
|
||||
'Compounding Explosion on `u` and under, rolls one `dy` for each die that lands on `u` or under, but adds the resulting explosion to the die that caused this explosion',
|
||||
inline: true,
|
||||
},
|
||||
],
|
||||
|
|
|
@ -8,7 +8,7 @@ import { queries } from 'db/common.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';
|
||||
|
||||
export const stats = async (message: DiscordenoMessage) => {
|
||||
// Light telemetry to see how many times a command is being run
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<string, string>, apiUserid: bigint, apiUserEmail: string, apiUserDelCode: string): Promise<Response> => {
|
||||
if (verifyQueryHasParams(query, ['user', 'email'])) {
|
||||
|
|
|
@ -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<string, string>, apiUserid: bigint): Promise<Response> => {
|
||||
if (verifyQueryHasParams(query, ['user'])) {
|
||||
|
|
|
@ -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<string, string>): Promise<Response> => {
|
||||
if (verifyQueryHasParams(query, ['user', 'email'])) {
|
||||
|
|
|
@ -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<string, string>, apiUserid: bigint): Promise<Response> => {
|
||||
if (verifyQueryHasParams(query, ['user', 'a'])) {
|
||||
|
|
|
@ -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<string, string>, 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 {
|
||||
|
|
|
@ -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<string, string>, apiUserid: bigint): Promise<Response> => {
|
||||
if (verifyQueryHasParams(query, ['user', 'channel'])) {
|
||||
|
|
|
@ -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<string, string>, apiUserid: bigint, path: string): Promise<Response> => {
|
||||
if (verifyQueryHasParams(query, ['user', 'channel'])) {
|
||||
|
|
|
@ -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<string, string>, apiUserid: bigint, path: string): Promise<Response> => {
|
||||
if (verifyQueryHasParams(query, ['user', 'channel', 'a'])) {
|
||||
|
|
|
@ -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<string, string>, apiUserid: bigint, path: string): Promise<Response> => {
|
||||
if (verifyQueryHasParams(query, ['user', 'a'])) {
|
||||
|
|
|
@ -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;
|
Loading…
Reference in New Issue