update links to be driven by config, update strings to use bot name from config

This commit is contained in:
Ean Milligan 2025-04-26 23:24:26 -04:00
parent 8d3c22a39f
commit f3a6a36fb0
12 changed files with 89 additions and 77 deletions

View File

@ -32,6 +32,15 @@ export const config = {
password: '', // Password for the account, user account may need to be authenticated with the "Standard" Authentication Type if this does not work out of the box password: '', // Password for the account, user account may need to be authenticated with the "Standard" Authentication Type if this does not work out of the box
name: '', // Name of the database Schema to use for the bot name: '', // Name of the database Schema to use for the bot
}, },
links: {
// Links that are used in the bot
sourceCode: 'https://github.com/Burn-E99/TheArtificer', // Link to the repository
supportServer: '', // Invite link to the Discord support server
roll20Formatting: 'https://help.roll20.net/hc/en-us/articles/360037773133-Dice-Reference', // Link to Roll20 Dice Reference
homePage: '', // Link to the bot's home/ad page
privacyPolicy: '', // Link to the current Privacy Policy
termsOfService: '', // Link to the current Terms of Service
},
logRolls: false, // Enables logging of roll commands, this should be left disabled for privacy, but exists to allow verification of rolls before deployment, all API rolls will always be logged no matter what this is set to logRolls: false, // Enables logging of roll commands, this should be left disabled for privacy, but exists to allow verification of rolls before deployment, all API rolls will always be logged no matter what this is set to
logChannel: 0n, // Discord channel ID where the bot should put startup messages and other error messages needed logChannel: 0n, // Discord channel ID where the bot should put startup messages and other error messages needed
reportChannel: 0n, // Discord channel ID where reports will be sent when using the built-in report command reportChannel: 0n, // Discord channel ID where reports will be sent when using the built-in report command

View File

@ -50,7 +50,7 @@ export const generateStats = (
embeds: [ embeds: [
{ {
color: infoColor2, color: infoColor2,
title: "The Artificer's Statistics:", title: `${config.name}'s Statistics:`,
timestamp: new Date().toISOString(), timestamp: new Date().toISOString(),
fields: [ fields: [
{ {
@ -99,7 +99,7 @@ export const generateApiStatus = (banned: boolean, active: boolean) => {
embeds: [ embeds: [
{ {
color: infoColor1, color: infoColor1,
title: `The Artificer's API is ${config.api.enable ? 'currently enabled' : 'currently disabled'}.`, title: `${config.name}'s API is ${config.api.enable ? 'currently enabled' : 'currently disabled'}.`,
description: banned ? 'API rolls are banned from being used in this guild.\n\nThis will not be reversed.' : `API rolls are ${apiStatus} in this guild.`, description: banned ? 'API rolls are banned from being used in this guild.\n\nThis will not be reversed.' : `API rolls are ${apiStatus} in this guild.`,
}, },
], ],
@ -137,20 +137,20 @@ export const generateApiKeyEmail = (email: string, key: string) => ({
}, },
{ {
name: 'Subject:', name: 'Subject:',
value: 'Artificer API Key', value: `${config.name} API Key`,
}, },
{ {
name: 'Body:', name: 'Body:',
value: `Hello Artificer API User, value: `Hello ${config.name} API User,
Welcome aboard The Artificer's API. You can find full details about the API on the GitHub: https://github.com/Burn-E99/TheArtificer Welcome aboard ${config.name}'s API. You can find full details about the API on the GitHub: ${config.links.sourceCode}
Your API Key is: ${key} Your API Key is: ${key}
Guard this well, as there is zero tolerance for API abuse. Guard this well, as there is zero tolerance for API abuse.
Welcome aboard, Welcome aboard,
The Artificer Developer - Ean Milligan`, ${config.name} Developer - Ean Milligan`,
}, },
], ],
}, },
@ -169,18 +169,18 @@ export const generateApiDeleteEmail = (email: string, deleteCode: string) => ({
}, },
{ {
name: 'Subject:', name: 'Subject:',
value: 'Artificer API Delete Code', value: `${config.name} API Delete Code`,
}, },
{ {
name: 'Body:', name: 'Body:',
value: `Hello Artificer API User, value: `Hello ${config.name} API User,
I am sorry to see you go. If you would like, please respond to this email detailing what I could have done better. I am sorry to see you go. If you would like, please respond to this email detailing what I could have done better.
As requested, here is your delete code: ${deleteCode} As requested, here is your delete code: ${deleteCode}
Sorry to see you go, Sorry to see you go,
The Artificer Developer - Ean Milligan`, ${config.name} Developer - Ean Milligan`,
}, },
], ],
}, },

View File

@ -8,6 +8,7 @@ import {
import apiCommands from './apiCmd/_index.ts'; import apiCommands from './apiCmd/_index.ts';
import { failColor } from '../commandUtils.ts'; import { failColor } from '../commandUtils.ts';
import utils from '../utils.ts'; import utils from '../utils.ts';
import config from '../../config.ts';
export const api = async (message: DiscordenoMessage, args: string[]) => { export const api = async (message: DiscordenoMessage, args: string[]) => {
// Light telemetry to see how many times a command is being run // Light telemetry to see how many times a command is being run
@ -74,8 +75,7 @@ export const api = async (message: DiscordenoMessage, args: string[]) => {
{ {
color: failColor, color: failColor,
title: 'API commands are powerful and can only be used by guild Owners and Admins.', title: 'API commands are powerful and can only be used by guild Owners and Admins.',
description: description: `For information on how to use the API, please check the GitHub README for more information [here](${config.links.sourceCode}).`,
'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

@ -7,15 +7,15 @@ import { infoColor1, infoColor2 } from '../../commandUtils.ts';
import utils from '../../utils.ts'; import utils from '../../utils.ts';
export const help = (message: DiscordenoMessage) => { export const help = (message: DiscordenoMessage) => {
message.send({ message
.send({
embeds: [ embeds: [
{ {
color: infoColor2, color: infoColor2,
title: "The Artificer's API Details:", title: `${config.name}'s API Details:`,
description: 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.
`The Artificer 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](https://github.com/Burn-E99/TheArtificer). For information on how to use the API, please check the GitHub README for more information [here](${config.links.sourceCode}).
You may enable and disable the API rolls for your guild as needed.`, You may enable and disable the API rolls for your guild as needed.`,
}, },
@ -45,7 +45,7 @@ You may enable and disable the API rolls for your guild as needed.`,
}, },
{ {
name: `\`${config.prefix}api delete\``, name: `\`${config.prefix}api delete\``,
value: "Deletes this channel's settings from The Artificer's database", value: `Deletes this channel's settings from ${config.name}'s database`,
inline: true, inline: true,
}, },
{ {
@ -61,5 +61,6 @@ You may enable and disable the API rolls for your guild as needed.`,
], ],
}, },
], ],
}).catch((e: Error) => utils.commonLoggers.messageSendError('apiHelp.ts:67', message, e)); })
.catch((e: Error) => utils.commonLoggers.messageSendError('apiHelp.ts:67', message, e));
}; };

View File

@ -5,6 +5,7 @@ import {
} from '../../../deps.ts'; } from '../../../deps.ts';
import { failColor, successColor } from '../../commandUtils.ts'; import { failColor, successColor } from '../../commandUtils.ts';
import utils from '../../utils.ts'; import utils from '../../utils.ts';
import config from '../../../config.ts';
export const deleteGuild = async (message: DiscordenoMessage) => { export const deleteGuild = async (message: DiscordenoMessage) => {
let errorOut = false; let errorOut = false;
@ -31,7 +32,7 @@ export const deleteGuild = async (message: DiscordenoMessage) => {
embeds: [ embeds: [
{ {
color: successColor, color: successColor,
title: "This guild's API setting has been removed from The Artificer's Database.", title: `This guild's API setting has been removed from ${config.name}'s Database.`,
}, },
], ],
}) })

View File

@ -21,7 +21,7 @@ export const auditDB = async (message: DiscordenoMessage) => {
// Get DB statistics // Get DB statistics
const auditQuery = await dbClient.query(`SELECT * FROM db_size;`).catch((e) => utils.commonLoggers.dbError('auditDB.ts:19', 'query', e)); const auditQuery = await dbClient.query(`SELECT * FROM db_size;`).catch((e) => utils.commonLoggers.dbError('auditDB.ts:19', 'query', e));
// Turn all tables into embed fields, currently only properly will handle 25 tables, but we'll fix that when artificer gets 26 tables // Turn all tables into embed fields, currently only properly will handle 25 tables, but we'll fix that when it gets 26 tables
const embedFields: Array<EmbedField> = []; const embedFields: Array<EmbedField> = [];
auditQuery.forEach((row: DBSizeData) => { auditQuery.forEach((row: DBSizeData) => {
embedFields.push({ embedFields.push({

View File

@ -17,7 +17,7 @@ export const help = (message: DiscordenoMessage) => {
embeds: [ embeds: [
{ {
color: infoColor2, color: infoColor2,
title: "The Artificer's Available Commands:", title: `${config.name}'s Available Commands:`,
fields: [ fields: [
{ {
name: `\`${config.prefix}?\``, name: `\`${config.prefix}?\``,

View File

@ -19,9 +19,9 @@ export const info = (message: DiscordenoMessage) => {
color: infoColor2, color: infoColor2,
title: `${config.name}, a Discord bot that specializing in rolling dice and calculating math`, title: `${config.name}, a Discord bot that specializing in rolling dice and calculating math`,
description: `${config.name} is developed by Ean AKA Burn_E99. description: `${config.name} is developed by Ean AKA Burn_E99.
Additional information can be found on my website [here](https://discord.burne99.com/TheArtificer/). Additional information can be found on my website [here](${config.links.homePage}).
Want to check out my source code? Check it out [here](https://github.com/Burn-E99/TheArtificer). Want to check out my source code? Check it out [here](${config.links.sourceCode}).
Need help with this bot? Join my support server [here](https://discord.gg/peHASXMZYv).`, Need help with this bot? Join my support server [here](${config.links.supportServer}).`,
}, },
], ],
}) })

View File

@ -20,12 +20,12 @@ export const privacy = (message: DiscordenoMessage) => {
title: 'Privacy Policy', title: 'Privacy Policy',
fields: [ fields: [
{ {
name: 'The Artificer does not track or collect user information via Discord.', 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 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 ${config.name} 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). For more details, please check out the Privacy Policy on the GitHub [here](${config.links.privacyPolicy}).
Terms of Service can also be found on GitHub [here](https://github.com/Burn-E99/TheArtificer/blob/master/TERMS.md). Terms of Service can also be found on GitHub [here](${config.links.termsOfService}).
Want me to ignore you? Simply run \`${config.prefix}opt-out\` and ${config.name} will no longer read your messages or respond to you.`, Want me to ignore you? Simply run \`${config.prefix}opt-out\` and ${config.name} will no longer read your messages or respond to you.`,
}, },

View File

@ -22,7 +22,7 @@ export const report = (message: DiscordenoMessage, args: string[]) => {
{ {
color: successColor, color: successColor,
title: 'Failed command has been reported to my developer.', title: 'Failed command has been reported to my developer.',
description: `For more in depth support, and information about planned maintenance, please join the support server [here](https://discord.gg/peHASXMZYv).`, description: `For more in depth support, and information about planned maintenance, please join the support server [here](${config.links.supportServer}).`,
}, },
], ],
}) })

View File

@ -6,6 +6,7 @@ import {
} from '../../deps.ts'; } from '../../deps.ts';
import { infoColor2 } from '../commandUtils.ts'; import { infoColor2 } from '../commandUtils.ts';
import utils from '../utils.ts'; import utils from '../utils.ts';
import config from '../../config.ts';
export const rip = (message: DiscordenoMessage) => { export const rip = (message: DiscordenoMessage) => {
// Light telemetry to see how many times a command is being run // Light telemetry to see how many times a command is being run
@ -16,7 +17,7 @@ export const rip = (message: DiscordenoMessage) => {
embeds: [ embeds: [
{ {
color: infoColor2, color: infoColor2,
title: 'The Artificer was built in memory of my Grandmother, Babka', title: `${config.name} was built in memory of my Grandmother, Babka`,
description: `With much love, Ean description: `With much love, Ean
December 21, 2020`, December 21, 2020`,

View File

@ -17,12 +17,12 @@ export const rollHelp = (message: DiscordenoMessage) => {
embeds: [ embeds: [
{ {
color: infoColor1, color: infoColor1,
title: "The Artificer's Roll Command Details:", 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. 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. This command also can fully solve math equations with parenthesis.
The Artificer supports most of the [Roll20 formatting](https://artificer.eanm.dev/roll20). More details and examples can be found [here](https://artificer.eanm.dev/roll20). ${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.`, Run \`[[???\` or \`[[rollDecorators\` for details on the roll decorators.`,
}, },