Set colors for all embeds

This commit is contained in:
Ean Milligan (Bastion) 2022-05-18 05:03:24 -04:00
parent 733908f2c0
commit 394ae211df
1 changed files with 37 additions and 9 deletions

View File

@ -1,26 +1,29 @@
import config from "../config.ts"; import config from "../config.ts";
const rollHelpColors = { const failColor = 0xe71212;
details: 0x6805e9, const warnColor = 0xe38f28;
decorators: 0x313bf9, const successColor = 0x0f8108;
results: 0x0f8108 const infoColor1 = 0x313bf9;
}; const infoColor2 = 0x6805e9;
export const constantCmds = { export const constantCmds = {
apiDeleteFail: { apiDeleteFail: {
embeds: [{ embeds: [{
color: failColor,
title: "Failed to delete this guild from the database.", title: "Failed to delete this guild from the database.",
description: "If this issue persists, please report this to the developers." description: "If this issue persists, please report this to the developers."
}] }]
}, },
apiGuildOnly: { apiGuildOnly: {
embeds: [{ embeds: [{
color: failColor,
title: "API commands are only available in guilds." title: "API commands are only available in guilds."
}] }]
}, },
apiHelp: { apiHelp: {
embeds: [ embeds: [
{ {
color: infoColor2,
title: "The Artificer's API Details:", 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. 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.
@ -28,6 +31,7 @@ export const constantCmds = {
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.`
}, { }, {
color: infoColor1,
title: "Available API Commands:", title: "Available API Commands:",
fields: [ fields: [
{ {
@ -65,23 +69,27 @@ export const constantCmds = {
}, },
apiPermError: { apiPermError: {
embeds: [{ embeds: [{
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: "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)."
}] }]
}, },
apiRemoveGuild: { apiRemoveGuild: {
embeds: [{ 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 Artifier's Database."
}] }]
}, },
apiStatusFail: { apiStatusFail: {
embeds: [{ embeds: [{
color: failColor,
title: "Failed to check API rolls status for this guild.", title: "Failed to check API rolls status for this guild.",
description: "If this issue persists, please report this to the developers." description: "If this issue persists, please report this to the developers."
}] }]
}, },
help: { help: {
embeds: [{ embeds: [{
color: infoColor2,
title: "The Artificer's Available Commands:", title: "The Artificer's Available Commands:",
fields: [ fields: [
{ {
@ -134,11 +142,13 @@ export const constantCmds = {
}, },
indev: { indev: {
embeds: [{ embeds: [{
color: warnColor,
title: "Command is in development, please try again later." title: "Command is in development, please try again later."
}] }]
}, },
info: { info: {
embeds: [{ embeds: [{
color: infoColor2,
title: "The Artificer, a Discord bot that specializing in rolling dice and calculating math", title: "The Artificer, a Discord bot that specializing in rolling dice and calculating math",
description: `The Artificer is developed by Ean AKA Burn_E99. description: `The Artificer 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](https://discord.burne99.com/TheArtificer/).
@ -148,11 +158,13 @@ export const constantCmds = {
}, },
loadingStats: { loadingStats: {
embeds: [{ embeds: [{
color: warnColor,
title: "Compiling latest statistics . . ." title: "Compiling latest statistics . . ."
}] }]
}, },
mention: { mention: {
embeds: [{ embeds: [{
color: infoColor1,
title: `Hello! I am ${config.name}!`, title: `Hello! I am ${config.name}!`,
fields: [{ fields: [{
name: "I am a bot that specializes in rolling dice and doing basic algebra", name: "I am a bot that specializes in rolling dice and doing basic algebra",
@ -162,6 +174,7 @@ export const constantCmds = {
}, },
privacy: { privacy: {
embeds: [{ embeds: [{
color: infoColor1,
title: "Privacy Policy", title: "Privacy Policy",
fields: [{ fields: [{
name: "The Artificer does not track or collect user information via Discord.", name: "The Artificer does not track or collect user information via Discord.",
@ -175,18 +188,21 @@ export const constantCmds = {
}, },
report: { report: {
embeds: [{ embeds: [{
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](https://discord.gg/peHASXMZYv).`
}] }]
}, },
reportFail: { reportFail: {
embeds: [{ embeds: [{
color: failColor,
title: "Please provide a short description of what failed", title: "Please provide a short description of what failed",
description: "Providing a short description helps my developer quickly diagnose what went wrong." description: "Providing a short description helps my developer quickly diagnose what went wrong."
}] }]
}, },
rip: { rip: {
embeds: [{ embeds: [{
color: infoColor2,
title: "The Artificer was built in memory of my Grandmother, Babka", title: "The Artificer was built in memory of my Grandmother, Babka",
description: `With much love, Ean description: `With much love, Ean
@ -196,7 +212,7 @@ export const constantCmds = {
rollHelp: { rollHelp: {
embeds: [ embeds: [
{ {
color: rollHelpColors.details, color: infoColor2,
title: "The Artificer's Roll Command Details:", title: "The Artificer'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.
@ -306,7 +322,7 @@ export const constantCmds = {
} }
] ]
}, { }, {
color: rollHelpColors.details, color: infoColor2,
fields: [ fields: [
{ {
name: "`!o>u` [Optional]", name: "`!o>u` [Optional]",
@ -319,7 +335,7 @@ export const constantCmds = {
} }
] ]
}, { }, {
color: rollHelpColors.decorators, color: infoColor1,
title: "Roll Command Decorators:", title: "Roll Command Decorators:",
description: `This command also has some useful decorators that can used. These decorators simply need to be placed after all rolls in the message. description: `This command also has some useful decorators that can used. These decorators simply need to be placed after all rolls in the message.
@ -360,7 +376,7 @@ export const constantCmds = {
} }
] ]
}, { }, {
color: rollHelpColors.results, color: successColor,
title: "Results Formatting:", title: "Results Formatting:",
description: "The results have some formatting applied on them to provide details on what happened during this roll.", description: "The results have some formatting applied on them to provide details on what happened during this roll.",
fields: [ fields: [
@ -383,11 +399,13 @@ export const constantCmds = {
}, },
rolling: { rolling: {
embeds: [{ embeds: [{
color: infoColor1,
title: "Rolling . . ." title: "Rolling . . ."
}] }]
}, },
version: { version: {
embeds: [{ embeds: [{
color: infoColor1,
title: `My current version is ${config.version}` title: `My current version is ${config.version}`
}] }]
} }
@ -395,12 +413,14 @@ export const constantCmds = {
export const generatePing = (time: number) => ({ export const generatePing = (time: number) => ({
embeds: [{ embeds: [{
color: infoColor1,
title: time === -1 ? "Ping?" : `Pong! Latency is ${time}ms.` title: time === -1 ? "Ping?" : `Pong! Latency is ${time}ms.`
}] }]
}); });
export const generateReport = (msg: string) => ({ export const generateReport = (msg: string) => ({
embeds: [{ embeds: [{
color: infoColor2,
title: "USER REPORT:", title: "USER REPORT:",
description: msg || "No message" description: msg || "No message"
}] }]
@ -408,6 +428,7 @@ export const generateReport = (msg: string) => ({
export const generateStats = (guildCount: number, channelCount: number, memberCount: number, rollCount: bigint, utilityCount: bigint) => ({ export const generateStats = (guildCount: number, channelCount: number, memberCount: number, rollCount: bigint, utilityCount: bigint) => ({
embeds: [{ embeds: [{
color: infoColor2,
title: "The Artificer's Statistics:", title: "The Artificer's Statistics:",
fields: [ fields: [
{ {
@ -437,6 +458,7 @@ export const generateStats = (guildCount: number, channelCount: number, memberCo
export const generateApiFailed = (args: string) => ({ export const generateApiFailed = (args: string) => ({
embeds: [{ embeds: [{
color: failColor,
title: `Failed to ${args} API rolls for this guild.`, title: `Failed to ${args} API rolls for this guild.`,
description: "If this issue persists, please report this to the developers." description: "If this issue persists, please report this to the developers."
}] }]
@ -444,6 +466,7 @@ export const generateApiFailed = (args: string) => ({
export const generateApiStatus = (banned: boolean, active: boolean) => ({ export const generateApiStatus = (banned: boolean, active: boolean) => ({
embeds: [{ embeds: [{
color: infoColor1,
title: `The Artificer's API is ${config.api.enable ? "currently enabled" : "currently disabled"}.`, title: `The Artificer'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 ${active ? "allowed" : "blocked from being used"} in this guild.` description: banned ? "API rolls are banned from being used in this guild.\n\nThis will not be reversed." : `API rolls are ${active ? "allowed" : "blocked from being used"} in this guild.`
}] }]
@ -451,12 +474,14 @@ export const generateApiStatus = (banned: boolean, active: boolean) => ({
export const generateApiSuccess = (args: string) => ({ export const generateApiSuccess = (args: string) => ({
embeds: [{ embeds: [{
color: successColor,
title: `API rolls have successfully been ${args} for this guild.` title: `API rolls have successfully been ${args} for this guild.`
}] }]
}); });
export const generateDMFailed = (user: string) => ({ export const generateDMFailed = (user: string) => ({
embeds: [{ embeds: [{
color: failColor,
title: `WARNING: ${user} could not be messaged.`, title: `WARNING: ${user} could not be messaged.`,
description: "If this issue persists, make sure direct messages are allowed from this server." description: "If this issue persists, make sure direct messages are allowed from this server."
}] }]
@ -465,6 +490,7 @@ export const generateDMFailed = (user: string) => ({
export const generateApiKeyEmail = (email: string, key: string) => ({ export const generateApiKeyEmail = (email: string, key: string) => ({
content: `<@${config.api.admin}> A USER HAS REQUESTED AN API KEY`, content: `<@${config.api.admin}> A USER HAS REQUESTED AN API KEY`,
embeds: [{ embeds: [{
color: infoColor1,
fields: [ fields: [
{ {
name: "Send to:", name: "Send to:",
@ -492,6 +518,7 @@ export const generateApiKeyEmail = (email: string, key: string) => ({
export const generateApiDeleteEmail = (email: string, deleteCode: string) => ({ export const generateApiDeleteEmail = (email: string, deleteCode: string) => ({
content: `<@${config.api.admin}> A USER HAS REQUESTED A DELETE CODE`, content: `<@${config.api.admin}> A USER HAS REQUESTED A DELETE CODE`,
embeds: [{ embeds: [{
color: infoColor1,
fields: [ fields: [
{ {
name: "Send to:", name: "Send to:",
@ -516,6 +543,7 @@ export const generateApiDeleteEmail = (email: string, deleteCode: string) => ({
export const generateRollError = (errorType: string, errorMsg: string) => ({ export const generateRollError = (errorType: string, errorMsg: string) => ({
embeds: [{ embeds: [{
color: failColor,
title: "Roll command encountered the following error:", title: "Roll command encountered the following error:",
fields: [{ fields: [{
name: errorType, name: errorType,