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
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
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

View File

@ -50,7 +50,7 @@ export const generateStats = (
embeds: [
{
color: infoColor2,
title: "The Artificer's Statistics:",
title: `${config.name}'s Statistics:`,
timestamp: new Date().toISOString(),
fields: [
{
@ -99,7 +99,7 @@ export const generateApiStatus = (banned: boolean, active: boolean) => {
embeds: [
{
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.`,
},
],
@ -137,20 +137,20 @@ export const generateApiKeyEmail = (email: string, key: string) => ({
},
{
name: 'Subject:',
value: 'Artificer API Key',
value: `${config.name} API Key`,
},
{
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}
Guard this well, as there is zero tolerance for API abuse.
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:',
value: 'Artificer API Delete Code',
value: `${config.name} API Delete Code`,
},
{
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.
As requested, here is your delete code: ${deleteCode}
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 { failColor } from '../commandUtils.ts';
import utils from '../utils.ts';
import config from '../../config.ts';
export const api = async (message: DiscordenoMessage, args: string[]) => {
// 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,
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](${config.links.sourceCode}).`,
},
],
})

View File

@ -7,59 +7,60 @@ import { infoColor1, infoColor2 } from '../../commandUtils.ts';
import utils from '../../utils.ts';
export const help = (message: DiscordenoMessage) => {
message.send({
embeds: [
{
color: infoColor2,
title: "The Artificer's API Details:",
description:
`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.
message
.send({
embeds: [
{
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.
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.`,
},
{
color: infoColor1,
title: 'Available API Commands:',
fields: [
{
name: `\`${config.prefix}api help\``,
value: 'This command',
inline: true,
},
{
name: `\`${config.prefix}api status\``,
value: 'Shows the current status of the API for the channel this was run in',
inline: true,
},
{
name: `\`${config.prefix}api allow/enable\``,
value: 'Allows API Rolls to be sent to the channel this was run in',
inline: true,
},
{
name: `\`${config.prefix}api block/disable\``,
value: 'Blocks API Rolls from being sent to the channel this was run in',
inline: true,
},
{
name: `\`${config.prefix}api delete\``,
value: "Deletes this channel's settings from The Artificer's database",
inline: true,
},
{
name: `\`${config.prefix}api show-warn\``,
value: 'Shows the API warning on all rolls sent to the channel this was run in',
inline: true,
},
{
name: `\`${config.prefix}api hide-warn\``,
value: 'Hides the API warning on all rolls sent to the channel this was run in',
inline: true,
},
],
},
],
}).catch((e: Error) => utils.commonLoggers.messageSendError('apiHelp.ts:67', message, e));
},
{
color: infoColor1,
title: 'Available API Commands:',
fields: [
{
name: `\`${config.prefix}api help\``,
value: 'This command',
inline: true,
},
{
name: `\`${config.prefix}api status\``,
value: 'Shows the current status of the API for the channel this was run in',
inline: true,
},
{
name: `\`${config.prefix}api allow/enable\``,
value: 'Allows API Rolls to be sent to the channel this was run in',
inline: true,
},
{
name: `\`${config.prefix}api block/disable\``,
value: 'Blocks API Rolls from being sent to the channel this was run in',
inline: true,
},
{
name: `\`${config.prefix}api delete\``,
value: `Deletes this channel's settings from ${config.name}'s database`,
inline: true,
},
{
name: `\`${config.prefix}api show-warn\``,
value: 'Shows the API warning on all rolls sent to the channel this was run in',
inline: true,
},
{
name: `\`${config.prefix}api hide-warn\``,
value: 'Hides the API warning on all rolls sent to the channel this was run in',
inline: true,
},
],
},
],
})
.catch((e: Error) => utils.commonLoggers.messageSendError('apiHelp.ts:67', message, e));
};

View File

@ -5,6 +5,7 @@ import {
} from '../../../deps.ts';
import { failColor, successColor } from '../../commandUtils.ts';
import utils from '../../utils.ts';
import config from '../../../config.ts';
export const deleteGuild = async (message: DiscordenoMessage) => {
let errorOut = false;
@ -31,7 +32,7 @@ export const deleteGuild = async (message: DiscordenoMessage) => {
embeds: [
{
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
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> = [];
auditQuery.forEach((row: DBSizeData) => {
embedFields.push({

View File

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

View File

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

View File

@ -22,7 +22,7 @@ export const report = (message: DiscordenoMessage, args: string[]) => {
{
color: successColor,
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';
import { infoColor2 } from '../commandUtils.ts';
import utils from '../utils.ts';
import config from '../../config.ts';
export const rip = (message: DiscordenoMessage) => {
// Light telemetry to see how many times a command is being run
@ -16,7 +17,7 @@ export const rip = (message: DiscordenoMessage) => {
embeds: [
{
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
December 21, 2020`,

View File

@ -17,12 +17,12 @@ export const rollHelp = (message: DiscordenoMessage) => {
embeds: [
{
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.
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.`,
},