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

Mass spelling fix

This commit is contained in:
Ean Milligan
2025-04-26 23:08:57 -04:00
parent 74c733308f
commit 864f281c60
38 changed files with 322 additions and 237 deletions

View File

@@ -74,7 +74,8 @@ export const api = async (message: DiscordenoMessage, args: string[]) => {
{
color: failColor,
title: 'API commands are powerful and can only be used by guild Owners and Admins.',
description: 'For information on how to use the API, please check the GitHub README for more information [here](https://github.com/Burn-E99/TheArtificer).',
description:
'For information on how to use the API, please check the GitHub README for more information [here](https://github.com/Burn-E99/TheArtificer).',
},
],
})

View File

@@ -31,7 +31,7 @@ export const deleteGuild = async (message: DiscordenoMessage) => {
embeds: [
{
color: successColor,
title: "This guild's API setting has been removed from The Artifier's Database.",
title: "This guild's API setting has been removed from The Artificer's Database.",
},
],
})

View File

@@ -23,7 +23,7 @@ export const showHideWarn = async (message: DiscordenoMessage, apiArg: string) =
await dbClient
.execute(`INSERT INTO allowed_guilds(guildid,channelid,hidewarn) values(?,?,?)`, [message.guildId, message.channelId, apiArg === 'hide-warn' ? 1 : 0])
.catch((e0) => {
utils.commonLoggers.dbError('showHideWarn.ts:25', 'insert inot', e0);
utils.commonLoggers.dbError('showHideWarn.ts:25', 'insert into', e0);
message.send(generateApiFailed(`${apiArg} on`)).catch((e: Error) => utils.commonLoggers.messageSendError('showHideWarn.ts:26', message, e));
errorOut = true;
});

View File

@@ -32,7 +32,7 @@ export const audit = (message: DiscordenoMessage, args: string[]) => {
break;
case 'guilds':
// [[audit guilds
// Shows breakdown of guilds and detials on them
// Shows breakdown of guilds and details on them
auditCommands.auditGuilds(message);
break;
default:

View File

@@ -37,58 +37,62 @@ Tot mem: ${guild.memberCount} | Real: ${localRealCount} | Bot: ${localBotCount}
`;
});
const b = await new Blob([auditText as BlobPart], { 'type': 'text' });
const tooBig = await new Blob(['tooBig' as BlobPart], { 'type': 'text' });
const b = await new Blob([auditText as BlobPart], { type: 'text' });
const tooBig = await new Blob(['tooBig' as BlobPart], { type: 'text' });
message.send({
embeds: [{
color: infoColor2,
title: 'Guilds Audit',
description: `Shows details of the guilds that ${config.name} serves.
message
.send({
embeds: [
{
color: infoColor2,
title: 'Guilds Audit',
description: `Shows details of the guilds that ${config.name} serves.
Please see attached file for audit details on cached guilds and members.`,
timestamp: new Date().toISOString(),
fields: [
{
name: 'Total Guilds:',
value: `${cache.guilds.size}`,
inline: true,
},
{
name: 'Cached Guilds:',
value: `${cachedGuilds}`,
inline: true,
},
{
name: 'Uncached Guilds:',
value: `${cache.dispatchedGuildIds.size}`,
inline: true,
},
{
name: 'Total Members\n(may be artificially higher if 1 user is in multiple guilds the bot is in):',
value: `${totalCount}`,
inline: true,
},
{
name: 'Cached Real People:',
value: `${realCount}`,
inline: true,
},
{
name: 'Cached Bots:',
value: `${botsCount}`,
inline: true,
},
{
name: 'Average members per guild:',
value: `${(totalCount / cache.guilds.size).toFixed(2)}`,
inline: true,
timestamp: new Date().toISOString(),
fields: [
{
name: 'Total Guilds:',
value: `${cache.guilds.size}`,
inline: true,
},
{
name: 'Cached Guilds:',
value: `${cachedGuilds}`,
inline: true,
},
{
name: 'Uncached Guilds:',
value: `${cache.dispatchedGuildIds.size}`,
inline: true,
},
{
name: 'Total Members\n(may be artificially higher if 1 user is in multiple guilds the bot is in):',
value: `${totalCount}`,
inline: true,
},
{
name: 'Cached Real People:',
value: `${realCount}`,
inline: true,
},
{
name: 'Cached Bots:',
value: `${botsCount}`,
inline: true,
},
{
name: 'Average members per guild:',
value: `${(totalCount / cache.guilds.size).toFixed(2)}`,
inline: true,
},
],
},
],
}],
file: {
'blob': b.size > 8388290 ? tooBig : b,
'name': 'auditDetails.txt',
},
}).catch((e: Error) => utils.commonLoggers.messageSendError('auditGuild.ts:19', message, e));
file: {
blob: b.size > 8388290 ? tooBig : b,
name: 'auditDetails.txt',
},
})
.catch((e: Error) => utils.commonLoggers.messageSendError('auditGuild.ts:19', message, e));
};

View File

@@ -7,27 +7,31 @@ import { infoColor1 } from '../../commandUtils.ts';
import utils from '../../utils.ts';
export const auditHelp = (message: DiscordenoMessage) => {
message.send({
embeds: [{
color: infoColor1,
title: 'Audit Help',
fields: [
message
.send({
embeds: [
{
name: `\`${config.prefix}audit help\``,
value: 'This command',
inline: true,
},
{
name: `\`${config.prefix}audit db\``,
value: 'Shows current DB table sizes',
inline: true,
},
{
name: `\`${config.prefix}audit guilds\``,
value: 'Shows breakdown of guilds and detials on them',
inline: true,
color: infoColor1,
title: 'Audit Help',
fields: [
{
name: `\`${config.prefix}audit help\``,
value: 'This command',
inline: true,
},
{
name: `\`${config.prefix}audit db\``,
value: 'Shows current DB table sizes',
inline: true,
},
{
name: `\`${config.prefix}audit guilds\``,
value: 'Shows breakdown of guilds and details on them',
inline: true,
},
],
},
],
}],
}).catch((e: Error) => utils.commonLoggers.messageSendError('auditHelp.ts:35', message, e));
})
.catch((e: Error) => utils.commonLoggers.messageSendError('auditHelp.ts:35', message, e));
};

View File

@@ -13,26 +13,26 @@ import utils from '../utils.ts';
const allEmojiAliases: string[] = [];
config.emojis.forEach((emji: EmojiConf) => {
allEmojiAliases.push(...emji.aliases);
config.emojis.forEach((curEmoji: EmojiConf) => {
allEmojiAliases.push(...curEmoji.aliases);
});
export const emoji = (message: DiscordenoMessage, command: string) => {
if (allEmojiAliases.includes(command)) {
// Start looping thru the possible emojis
config.emojis.some((emji: EmojiConf) => {
log(LT.LOG, `Checking if command was emoji ${JSON.stringify(emji)}`);
config.emojis.some((curEmoji: EmojiConf) => {
log(LT.LOG, `Checking if command was emoji ${JSON.stringify(curEmoji)}`);
// If a match gets found
if (emji.aliases.indexOf(command || '') > -1) {
if (curEmoji.aliases.indexOf(command || '') > -1) {
// Light telemetry to see how many times a command is being run
dbClient.execute(queries.callIncCnt('emojis')).catch((e) => utils.commonLoggers.dbError('emojis.ts:28', 'call sproc INC_CNT on', e));
// Send the needed emoji
message
.send(`<${emji.animated ? 'a' : ''}:${emji.name}:${emji.id}>`)
.send(`<${curEmoji.animated ? 'a' : ''}:${curEmoji.name}:${curEmoji.id}>`)
.catch((e: Error) => utils.commonLoggers.messageSendError('emoji.ts:33', message, e));
// And attempt to delete if needed
if (emji.deleteSender) {
if (curEmoji.deleteSender) {
message.delete().catch((e: Error) => utils.commonLoggers.messageDeleteError('emoji.ts:36', message, e));
}
return true;

View File

@@ -10,7 +10,7 @@ import utils from '../utils.ts';
export const help = (message: DiscordenoMessage) => {
// Light telemetry to see how many times a command is being run
dbClient.execute(queries.callIncCnt('help')).catch((e) => utils.commonLoggers.dbError('htlp.ts:15', 'call sproc INC_CNT on', e));
dbClient.execute(queries.callIncCnt('help')).catch((e) => utils.commonLoggers.dbError('help.ts:15', 'call sproc INC_CNT on', e));
message
.send({
@@ -91,8 +91,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,
},
],

View File

@@ -21,8 +21,7 @@ export const privacy = (message: DiscordenoMessage) => {
fields: [
{
name: 'The Artificer 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 The Artificer 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 The Artificer can see.
For more details, please check out the Privacy Policy on the GitHub [here](https://github.com/Burn-E99/TheArtificer/blob/master/PRIVACY.md).

View File

@@ -49,7 +49,7 @@ export const roll = async (message: DiscordenoMessage, args: string[], command:
return;
}
// Rejoin all of the args and send it into the solver, if solver returns a falsy item, an error object will be substituded in
// Rejoin all of the args and send it into the solver, if solver returns a falsy item, an error object will be substituted in
const rollCmd = message.content.substring(2);
queueRoll({
@@ -60,6 +60,6 @@ export const roll = async (message: DiscordenoMessage, args: string[], command:
originalCommand,
});
} catch (e) {
log(LT.ERROR, `Undandled Error: ${JSON.stringify(e)}`);
log(LT.ERROR, `Unhandled Error: ${JSON.stringify(e)}`);
}
};

View File

@@ -64,7 +64,9 @@ export const getModifiers = (m: DiscordenoMessage, args: string[], command: stri
}
if (modifiers.gms.length < 1) {
// If -gm is on and none were found, throw an error
m.edit(generateRollError(errorType, 'Must specifiy at least one GM by @mentioning them')).catch((e) => utils.commonLoggers.messageEditError('getModifiers.ts:66', m, e));
m.edit(generateRollError(errorType, 'Must specify at least one GM by @mentioning them')).catch((e) =>
utils.commonLoggers.messageEditError('getModifiers.ts:66', m, e)
);
if (DEVMODE && config.logRolls) {
// If enabled, log rolls so we can verify the bots math
@@ -81,7 +83,9 @@ export const getModifiers = (m: DiscordenoMessage, args: string[], command: stri
if (!args[i] || (args[i].toLowerCase()[0] !== 'd' && args[i].toLowerCase()[0] !== 'a')) {
// If -o is on and asc or desc was not specified, error out
m.edit(generateRollError(errorType, 'Must specifiy `a` or `d` to order the rolls ascending or descending')).catch((e) => utils.commonLoggers.messageEditError('getModifiers.ts:81', m, e));
m.edit(generateRollError(errorType, 'Must specify `a` or `d` to order the rolls ascending or descending')).catch((e) =>
utils.commonLoggers.messageEditError('getModifiers.ts:81', m, e)
);
if (DEVMODE && config.logRolls) {
// If enabled, log rolls so we can verify the bots math
@@ -108,7 +112,9 @@ export const getModifiers = (m: DiscordenoMessage, args: string[], command: stri
// maxRoll and nominalRoll cannot both be on, throw an error
if (modifiers.maxRoll && modifiers.nominalRoll) {
m.edit(generateRollError(errorType, 'Cannot maximise and nominise the roll at the same time')).catch((e) => utils.commonLoggers.messageEditError('getModifiers.ts:106', m, e));
m.edit(generateRollError(errorType, 'Cannot maximize and nominize the roll at the same time')).catch((e) =>
utils.commonLoggers.messageEditError('getModifiers.ts:106', m, e)
);
if (DEVMODE && config.logRolls) {
// If enabled, log rolls so we can verify the bots math

View File

@@ -48,8 +48,9 @@ Examples: \`${config.prefix}d20${config.postfix} -nd\`, \`${config.prefix}d20${c
inline: true,
},
{
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',
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',
inline: true,
},
{

View File

@@ -72,27 +72,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,
},
{
@@ -187,27 +192,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,
},
],

View File

@@ -40,8 +40,8 @@ export const stats = async (message: DiscordenoMessage) => {
rolls,
total - rolls,
rollRate,
totalRate - rollRate,
),
totalRate - rollRate
)
).catch((e: Error) => utils.commonLoggers.messageEditError('stats.ts:38', m, e));
} catch (e) {
utils.commonLoggers.messageSendError('stats.ts:41', message, e as Error);