From 394ae211df5fca7bd6f437e658f1126b9df90a13 Mon Sep 17 00:00:00 2001 From: "Ean Milligan (Bastion)" Date: Wed, 18 May 2022 05:03:24 -0400 Subject: [PATCH] Set colors for all embeds --- src/constantCmds.ts | 46 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/src/constantCmds.ts b/src/constantCmds.ts index 35236ec..d6c90e9 100644 --- a/src/constantCmds.ts +++ b/src/constantCmds.ts @@ -1,26 +1,29 @@ import config from "../config.ts"; -const rollHelpColors = { - details: 0x6805e9, - decorators: 0x313bf9, - results: 0x0f8108 -}; +const failColor = 0xe71212; +const warnColor = 0xe38f28; +const successColor = 0x0f8108; +const infoColor1 = 0x313bf9; +const infoColor2 = 0x6805e9; export const constantCmds = { apiDeleteFail: { embeds: [{ + color: failColor, title: "Failed to delete this guild from the database.", description: "If this issue persists, please report this to the developers." }] }, apiGuildOnly: { embeds: [{ + color: failColor, title: "API commands are only available in guilds." }] }, apiHelp: { 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. @@ -28,6 +31,7 @@ export const constantCmds = { You may enable and disable the API rolls for your guild as needed.` }, { + color: infoColor1, title: "Available API Commands:", fields: [ { @@ -65,23 +69,27 @@ export const constantCmds = { }, apiPermError: { embeds: [{ + 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)." }] }, apiRemoveGuild: { embeds: [{ + color: successColor, title: "This guild's API setting has been removed from The Artifier's Database." }] }, apiStatusFail: { embeds: [{ + color: failColor, title: "Failed to check API rolls status for this guild.", description: "If this issue persists, please report this to the developers." }] }, help: { embeds: [{ + color: infoColor2, title: "The Artificer's Available Commands:", fields: [ { @@ -134,11 +142,13 @@ export const constantCmds = { }, indev: { embeds: [{ + color: warnColor, title: "Command is in development, please try again later." }] }, info: { embeds: [{ + color: infoColor2, title: "The Artificer, a Discord bot that specializing in rolling dice and calculating math", description: `The Artificer is developed by Ean AKA Burn_E99. Additional information can be found on my website [here](https://discord.burne99.com/TheArtificer/). @@ -148,11 +158,13 @@ export const constantCmds = { }, loadingStats: { embeds: [{ + color: warnColor, title: "Compiling latest statistics . . ." }] }, mention: { embeds: [{ + color: infoColor1, title: `Hello! I am ${config.name}!`, fields: [{ name: "I am a bot that specializes in rolling dice and doing basic algebra", @@ -162,6 +174,7 @@ export const constantCmds = { }, privacy: { embeds: [{ + color: infoColor1, title: "Privacy Policy", fields: [{ name: "The Artificer does not track or collect user information via Discord.", @@ -175,18 +188,21 @@ export const constantCmds = { }, report: { embeds: [{ + 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).` }] }, reportFail: { embeds: [{ + color: failColor, title: "Please provide a short description of what failed", description: "Providing a short description helps my developer quickly diagnose what went wrong." }] }, rip: { embeds: [{ + color: infoColor2, title: "The Artificer was built in memory of my Grandmother, Babka", description: `With much love, Ean @@ -196,7 +212,7 @@ export const constantCmds = { rollHelp: { embeds: [ { - color: rollHelpColors.details, + color: infoColor2, 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. @@ -306,7 +322,7 @@ export const constantCmds = { } ] }, { - color: rollHelpColors.details, + color: infoColor2, fields: [ { name: "`!o>u` [Optional]", @@ -319,7 +335,7 @@ export const constantCmds = { } ] }, { - color: rollHelpColors.decorators, + color: infoColor1, 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. @@ -360,7 +376,7 @@ export const constantCmds = { } ] }, { - color: rollHelpColors.results, + color: successColor, title: "Results Formatting:", description: "The results have some formatting applied on them to provide details on what happened during this roll.", fields: [ @@ -383,11 +399,13 @@ export const constantCmds = { }, rolling: { embeds: [{ + color: infoColor1, title: "Rolling . . ." }] }, version: { embeds: [{ + color: infoColor1, title: `My current version is ${config.version}` }] } @@ -395,12 +413,14 @@ export const constantCmds = { export const generatePing = (time: number) => ({ embeds: [{ + color: infoColor1, title: time === -1 ? "Ping?" : `Pong! Latency is ${time}ms.` }] }); export const generateReport = (msg: string) => ({ embeds: [{ + color: infoColor2, title: "USER REPORT:", 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) => ({ embeds: [{ + color: infoColor2, title: "The Artificer's Statistics:", fields: [ { @@ -437,6 +458,7 @@ export const generateStats = (guildCount: number, channelCount: number, memberCo export const generateApiFailed = (args: string) => ({ embeds: [{ + color: failColor, title: `Failed to ${args} API rolls for this guild.`, 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) => ({ embeds: [{ + color: infoColor1, 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.` }] @@ -451,12 +474,14 @@ export const generateApiStatus = (banned: boolean, active: boolean) => ({ export const generateApiSuccess = (args: string) => ({ embeds: [{ + color: successColor, title: `API rolls have successfully been ${args} for this guild.` }] }); export const generateDMFailed = (user: string) => ({ embeds: [{ + color: failColor, title: `WARNING: ${user} could not be messaged.`, 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) => ({ content: `<@${config.api.admin}> A USER HAS REQUESTED AN API KEY`, embeds: [{ + color: infoColor1, fields: [ { name: "Send to:", @@ -492,6 +518,7 @@ export const generateApiKeyEmail = (email: string, key: string) => ({ export const generateApiDeleteEmail = (email: string, deleteCode: string) => ({ content: `<@${config.api.admin}> A USER HAS REQUESTED A DELETE CODE`, embeds: [{ + color: infoColor1, fields: [ { name: "Send to:", @@ -516,6 +543,7 @@ export const generateApiDeleteEmail = (email: string, deleteCode: string) => ({ export const generateRollError = (errorType: string, errorMsg: string) => ({ embeds: [{ + color: failColor, title: "Roll command encountered the following error:", fields: [{ name: errorType,