From 65a94ceb6cacce0a98ec3f320083f539062950b4 Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Fri, 14 Jul 2023 09:27:15 +0200 Subject: [PATCH] fix: Added more configurable options for user replies --- commands/filters.js | 3 ++- commands/help.js | 8 +++++--- commands/play.js | 4 ++-- config.json.example | 12 ++++++++++++ index.js | 4 ++-- 5 files changed, 23 insertions(+), 8 deletions(-) diff --git a/commands/filters.js b/commands/filters.js index 0df792b..adad394 100644 --- a/commands/filters.js +++ b/commands/filters.js @@ -9,6 +9,7 @@ const { } = require('discord.js'); const { embedColors, + embedIcons, filterList, filterThreadAmount } = require('../config.json'); @@ -86,7 +87,7 @@ module.exports = { embeds: [ new EmbedBuilder() .setDescription( - '**Toggle filters** (beta)\nToggle or disable audio filters for playback.' + `**Toggle filters** ${embedIcons.beta}\nToggle or disable audio filters for playback.` ) .setColor(embedColors.colorInfo) ], diff --git a/commands/help.js b/commands/help.js index 92d52d4..aef6567 100644 --- a/commands/help.js +++ b/commands/help.js @@ -1,6 +1,6 @@ const { SlashCommandBuilder } = require('@discordjs/builders'); const { EmbedBuilder } = require('discord.js'); -const { embedColors } = require('../config.json'); +const { embedColors, embedIcons, botInfo } = require('../config.json'); module.exports = { data: new SlashCommandBuilder() @@ -12,7 +12,7 @@ module.exports = { embeds: [ new EmbedBuilder() .setDescription( - '**List of commands**\n' + + `${embedIcons.rule} **List of commands**\n` + '`/help` - Show this menu.\n' + '`/play` `query` - Add a track or playlist to the queue by searching or url.\n' + '`/pause` - Pause or resume the current track.\n' + @@ -22,7 +22,9 @@ module.exports = { '`/volume` `[percentage]` - Show or set the playback volume for tracks.\n' + '`/skip` `[trackNumber]` - Skip the current track.\n' + '`/remove` `trackNumber` - Remove a specific track from the queue.\n' + - '`/leave` - Remove bot from voice channel and clear the queue.\n' + '`/leave` - Remove bot from voice channel and clear the queue.\n\n' + + `${embedIcons.support} **Support server**\nJoin the support server for help or suggestions: \n${botInfo.supportServerInviteUrl}\n\n` + + `${embedIcons.bot} **Invite the bot**\nAdd me to another server: \n[Click me!](${botInfo.botInviteUrl})` ) .setColor(embedColors.colorInfo) ] diff --git a/commands/play.js b/commands/play.js index 51a267c..7941988 100644 --- a/commands/play.js +++ b/commands/play.js @@ -1,7 +1,7 @@ const { SlashCommandBuilder } = require('@discordjs/builders'); const { useMainPlayer, useQueue } = require('discord-player'); const { EmbedBuilder } = require('discord.js'); -const { embedColors, playerOptions } = require('../config.json'); +const { embedColors, playerOptions, botInfo } = require('../config.json'); module.exports = { data: new SlashCommandBuilder() @@ -57,7 +57,7 @@ module.exports = { embeds: [ new EmbedBuilder() .setDescription( - '**Unsupported Source**\nThis audio source is a YouTube live stream, which is currently not a supported format.\n\n_If you think that this is incorrect, please submit a bug report in the bot [support server](https://discord.gg/t6Bm8wPpXB)._' + `**Unsupported Source**\nThis audio source is a YouTube live stream, which is currently not a supported format.\n\n_If you think that this is incorrect, please submit a bug report in the bot [support server](${botInfo.supportServerInviteUrl})._` ) .setColor(embedColors.colorWarning) ] diff --git a/config.json.example b/config.json.example index b623a7a..76b608b 100644 --- a/config.json.example +++ b/config.json.example @@ -1,4 +1,10 @@ { + "botInfo": { + "name": "Cadence", + "websiteUrl": "Unknown", + "botInviteUrl": "Unknown", + "supportServerInviteUrl": "Unknown" + }, "systemServerGuildIds": [ "Server id where system commands can be used", "Another server id where system commands can be used" @@ -29,6 +35,12 @@ "leftChar": "▬", "rightChar": "▬" }, + "embedIcons": { + "beta": "`beta`", + "rule": "📒", + "support": "❓", + "bot": "🤖" + }, "filterThreadAmount": "2", "filterList": [ { diff --git a/index.js b/index.js index 77c904f..7f50aa7 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ const logger = require('./services/logger.js'); const { EmbedBuilder } = require('discord.js'); const { Player, onBeforeCreateStream } = require('discord-player'); const { stream } = require('yt-stream'); -const { embedColors } = require('./config.json'); +const { embedColors, botInfo } = require('./config.json'); require('dotenv').config(); // Setup required permissions for the bot to work @@ -186,7 +186,7 @@ client.on('interactionCreate', async (interaction) => { embeds: [ new EmbedBuilder() .setDescription( - '**Unexpected Error**\nThere was an error while executing this command! Please try again.\n\n_If this issue persists, please submit a bug report in the bot [support server](https://discord.gg/t6Bm8wPpXB)._' + `**Unexpected Error**\nThere was an error while executing this command! Please try again.\n\n_If this issue persists, please submit a bug report in the bot [support server](${botInfo.supportServerInviteUrl})._` ) .setColor(embedColors.colorError) ]