From 348ac90cba4b571ef53d9859eba98f225f4b75d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Tue, 6 Jun 2023 02:27:46 +0300 Subject: [PATCH] Move emojis to messages variable --- src/Client.ts | 5 ++- src/client/commands/bug.ts | 6 ++-- src/client/commands/help.ts | 6 ++-- src/client/commands/invite.ts | 4 +-- src/client/commands/list.ts | 6 ++-- src/client/commands/maintenance.ts | 4 +-- src/client/commands/next.ts | 4 +-- src/client/commands/nowplaying.ts | 4 +-- src/client/commands/play.ts | 18 +++++------ src/client/commands/prev.ts | 4 +-- src/client/commands/statistics.ts | 8 ++--- src/client/commands/status.ts | 6 ++-- src/client/commands/stop.ts | 6 ++-- src/client/emojis.ts | 44 -------------------------- src/client/events/interactionCreate.ts | 8 ++--- src/client/events/ready.ts | 4 --- src/client/funcs/check.ts | 7 ++-- src/client/funcs/play.ts | 16 +++++----- src/client/messages.ts | 14 +++++++- 19 files changed, 68 insertions(+), 106 deletions(-) delete mode 100644 src/client/emojis.ts diff --git a/src/Client.ts b/src/Client.ts index 1a85951..2bbd899 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -6,9 +6,10 @@ import Streamer from "./client/classes/Streamer"; import Statistics from "./client/classes/Statistics"; import { command } from "./client/commands"; import config from "./config"; -import { messages } from "./client/messages"; import { events } from "./client/events" import { funcs } from "./client/funcs"; +import { messages } from "./client/messages"; + const GatewayIntents = new IntentsBitField(); GatewayIntents.add( @@ -28,7 +29,6 @@ export default class RadioClient extends Client { public streamer: Streamer | null; public statistics: Statistics | null; public radio: Radio | null; - public messageEmojis: any | null; public developers: string | undefined; constructor() { @@ -41,7 +41,6 @@ export default class RadioClient extends Client { this.streamer = null; this.statistics = null; this.radio = null; - this.messageEmojis = null; console.log('RadioX ' + this.config.version); console.log('Internet Radio to your Discord guild'); diff --git a/src/client/commands/bug.ts b/src/client/commands/bug.ts index f3a4b18..06bf88b 100644 --- a/src/client/commands/bug.ts +++ b/src/client/commands/bug.ts @@ -7,7 +7,7 @@ export default { category: 'info', async execute(interaction: ChatInputCommandInteraction, client: RadioClient) { if(!client.user) return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.maintenance, + content: client.messages.emojis["error"] + client.messages.maintenance, ephemeral: true }); @@ -18,13 +18,13 @@ export default { const embed = new EmbedBuilder() .setTitle(message.bugTitle) - .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, '')) + .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messages.emojis["logo"].replace(/[^0-9]+/g, '')) .setColor(client.config.embedColor as ColorResolvable) .setDescription(message.bugDescription) .setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png') .setFooter({ text: client.messages.footerText, - iconURL: "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '') + iconURL: "https://cdn.discordapp.com/emojis/" + client.messages.emojis["eximiabots"].replace(/[^0-9]+/g, '') }); interaction.reply({ diff --git a/src/client/commands/help.ts b/src/client/commands/help.ts index 8078419..d161c99 100644 --- a/src/client/commands/help.ts +++ b/src/client/commands/help.ts @@ -8,7 +8,7 @@ export default { execute(interaction: ChatInputCommandInteraction, client: RadioClient) { if(!client.user) return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.maintenance, + content: client.messages.emojis["error"] + client.messages.maintenance, ephemeral: true }); @@ -28,13 +28,13 @@ export default { const embed = new EmbedBuilder() .setTitle(message.helpTitle) - .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, '')) + .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messages.emojis["logo"].replace(/[^0-9]+/g, '')) .setColor(client.config.embedColor as ColorResolvable) .setDescription(message.helpDescription) .setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png') .setFooter({ text: client.messages.footerText, - iconURL: "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '') + iconURL: "https://cdn.discordapp.com/emojis/" + client.messages.emojis["eximiabots"].replace(/[^0-9]+/g, '') }); interaction.reply({ diff --git a/src/client/commands/invite.ts b/src/client/commands/invite.ts index a8fc1e7..16d71d7 100644 --- a/src/client/commands/invite.ts +++ b/src/client/commands/invite.ts @@ -8,7 +8,7 @@ export default { execute(interaction: ChatInputCommandInteraction, client: RadioClient) { if(!client.user) return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.maintenance, + content: client.messages.emojis["error"] + client.messages.maintenance, ephemeral: true }); @@ -21,7 +21,7 @@ export default { .setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png') .setFooter({ text: client.messages.footerText, - iconURL: "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '') + iconURL: "https://cdn.discordapp.com/emojis/" + client.messages.emojis["eximiabots"].replace(/[^0-9]+/g, '') }); interaction.reply({ diff --git a/src/client/commands/list.ts b/src/client/commands/list.ts index beac6e5..7acc4a8 100644 --- a/src/client/commands/list.ts +++ b/src/client/commands/list.ts @@ -11,7 +11,7 @@ export default { if(!client.stations) { message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild); return interaction.reply({ - content: client.messageEmojis["error"] + message.errorToGetPlaylist, + content: client.messages.emojis["error"] + message.errorToGetPlaylist, ephemeral: true }); } @@ -29,13 +29,13 @@ export default { let embed = new EmbedBuilder() .setTitle(client.messages.listTitle) - .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["list"].replace(/[^0-9]+/g, '')) + .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messages.emojis["list"].replace(/[^0-9]+/g, '')) .setColor(client.config.embedColor as ColorResolvable) .setDescription(stations) .setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png') .setFooter({ text: client.messages.footerText, - iconURL: "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '') + iconURL: "https://cdn.discordapp.com/emojis/" + client.messages.emojis["eximiabots"].replace(/[^0-9]+/g, '') }); interaction.reply({ diff --git a/src/client/commands/maintenance.ts b/src/client/commands/maintenance.ts index 42fcc2a..bc269f2 100644 --- a/src/client/commands/maintenance.ts +++ b/src/client/commands/maintenance.ts @@ -14,7 +14,7 @@ export default { let message: any = {}; if(!client.funcs.isDev(client.config.devId, interaction.user.id)) return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.notAllowed, + content: client.messages.emojis["error"] + client.messages.notAllowed, ephemeral: true }); @@ -123,7 +123,7 @@ export default { .setDescription(options.find((option: APISelectMenuOption) => option.value == action)?.label || "-") .setFooter({ text: client.messages.footerText, - iconURL: "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '') + iconURL: "https://cdn.discordapp.com/emojis/" + client.messages.emojis["eximiabots"].replace(/[^0-9]+/g, '') }); interaction.reply({ diff --git a/src/client/commands/next.ts b/src/client/commands/next.ts index 5b6ba54..02dc465 100644 --- a/src/client/commands/next.ts +++ b/src/client/commands/next.ts @@ -11,7 +11,7 @@ export default { const radio = client.radio?.get(interaction.guild?.id); if(!client.stations) return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.maintenance, + content: client.messages.emojis["error"] + client.messages.maintenance, ephemeral: true }); @@ -21,7 +21,7 @@ export default { let station = client.stations[index]; if(!station) return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.noSearchResults, + content: client.messages.emojis["error"] + client.messages.noSearchResults, ephemeral: true }); diff --git a/src/client/commands/nowplaying.ts b/src/client/commands/nowplaying.ts index 41fe19e..04e7a6b 100644 --- a/src/client/commands/nowplaying.ts +++ b/src/client/commands/nowplaying.ts @@ -21,13 +21,13 @@ export default { const embed = new EmbedBuilder() .setTitle(client.messages.nowplayingTitle) - .setThumbnail((radio.station.logo || "https://cdn.discordapp.com/emojis/" + client.messageEmojis["play"].replace(/[^0-9]+/g, ''))) + .setThumbnail((radio.station.logo || "https://cdn.discordapp.com/emojis/" + client.messages.emojis["play"].replace(/[^0-9]+/g, ''))) .setColor(client.config.embedColor as ColorResolvable) .setDescription(message.nowplayingDescription) .setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png') .setFooter({ text: client.messages.footerText, - iconURL: "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '') + iconURL: "https://cdn.discordapp.com/emojis/" + client.messages.emojis["eximiabots"].replace(/[^0-9]+/g, '') }); interaction.reply({ diff --git a/src/client/commands/play.ts b/src/client/commands/play.ts index ba378a5..14b5b74 100644 --- a/src/client/commands/play.ts +++ b/src/client/commands/play.ts @@ -16,7 +16,7 @@ export default { if(!client.stations) { message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild); return interaction.reply({ - content: client.messageEmojis["error"] + message.errorToGetPlaylist, + content: client.messages.emojis["error"] + message.errorToGetPlaylist, ephemeral: true }); } @@ -39,12 +39,12 @@ export default { if(!(interaction.member instanceof GuildMember)) return; const voiceChannel = interaction.member?.voice.channel; if (!voiceChannel) return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.noVoiceChannel, + content: client.messages.emojis["error"] + client.messages.noVoiceChannel, ephemeral: true }); if (radio) { if (voiceChannel !== radio.voiceChannel) return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.wrongVoiceChannel, + content: client.messages.emojis["error"] + client.messages.wrongVoiceChannel, ephemeral: true }); } @@ -55,13 +55,13 @@ export default { const permissions = voiceChannel.permissionsFor(interaction.client.user); if (!permissions?.has(PermissionFlagsBits.Connect)) { return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.noPermsConnect, + content: client.messages.emojis["error"] + client.messages.noPermsConnect, ephemeral: true }); } if (!permissions?.has(PermissionFlagsBits.Speak)) { return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.noPermsSpeak, + content: client.messages.emojis["error"] + client.messages.noPermsSpeak, ephemeral: true }); } @@ -71,7 +71,7 @@ export default { const number = parseInt((query - 1) as unknown as string); if (number > client.stations.length - 1) { return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.wrongStationNumber, + content: client.messages.emojis["error"] + client.messages.wrongStationNumber, ephemeral: true }); } else { @@ -80,7 +80,7 @@ export default { } else { if(!(typeof query === 'string')) return; if(query.length < 3) return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.tooShortSearch, + content: client.messages.emojis["error"] + client.messages.tooShortSearch, ephemeral: true }); @@ -96,7 +96,7 @@ export default { const sstation = await client.stations.search(query, type); if (!sstation) return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.noSearchResults, + content: client.messages.emojis["error"] + client.messages.noSearchResults, ephemeral: true }); station = sstation; @@ -142,7 +142,7 @@ export default { console.log(error); client.radio?.delete(interaction.guild?.id); return interaction.reply({ - content: client.messageEmojis["error"] + `An error occured: ${error}`, + content: client.messages.emojis["error"] + `An error occured: ${error}`, ephemeral: true }); } diff --git a/src/client/commands/prev.ts b/src/client/commands/prev.ts index 6e6e707..d705c46 100644 --- a/src/client/commands/prev.ts +++ b/src/client/commands/prev.ts @@ -12,7 +12,7 @@ export default { const radio = client.radio?.get(interaction.guild?.id); if(!client.stations) return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.maintenance, + content: client.messages.emojis["error"] + client.messages.maintenance, ephemeral: true }); @@ -22,7 +22,7 @@ export default { let station = client.stations[index]; if(!station) return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.noSearchResults, + content: client.messages.emojis["error"] + client.messages.noSearchResults, ephemeral: true }); diff --git a/src/client/commands/statistics.ts b/src/client/commands/statistics.ts index 73978fb..822d627 100644 --- a/src/client/commands/statistics.ts +++ b/src/client/commands/statistics.ts @@ -10,7 +10,7 @@ export default { let message: any = {}; if(!interaction.guild) return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.maintenance, + content: client.messages.emojis["error"] + client.messages.maintenance, ephemeral: true }); @@ -22,7 +22,7 @@ export default { if(!client.stations) { message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild); return interaction.reply({ - content: client.messageEmojis["error"] + message.errorToGetPlaylist, + content: client.messages.emojis["error"] + message.errorToGetPlaylist, ephemeral: true }); } @@ -35,13 +35,13 @@ export default { const embed = new EmbedBuilder() .setTitle(client.messages.statisticsTitle) - .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["statistics"].replace(/[^0-9]+/g, '')) + .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messages.emojis["statistics"].replace(/[^0-9]+/g, '')) .setColor(client.config.embedColor as ColorResolvable) .setDescription(statistics) .setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png') .setFooter({ text: client.messages.footerText, - iconURL: "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '') + iconURL: "https://cdn.discordapp.com/emojis/" + client.messages.emojis["eximiabots"].replace(/[^0-9]+/g, '') }); interaction.reply({ diff --git a/src/client/commands/status.ts b/src/client/commands/status.ts index 52e1bb3..aa6a15b 100644 --- a/src/client/commands/status.ts +++ b/src/client/commands/status.ts @@ -9,7 +9,7 @@ export default { let message: any = {}; if(!client.user) return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.maintenance, + content: client.messages.emojis["error"] + client.messages.maintenance, ephemeral: true }); @@ -18,7 +18,7 @@ export default { const embed = new EmbedBuilder() .setTitle(message.statusTitle) - .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, '')) + .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messages.emojis["logo"].replace(/[^0-9]+/g, '')) .setColor(client.config.embedColor as ColorResolvable) .addFields([ { name: client.messages.statusField1, value: uptime }, @@ -30,7 +30,7 @@ export default { .setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png') .setFooter({ text: client.messages.footerText, - iconURL: "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '') + iconURL: "https://cdn.discordapp.com/emojis/" + client.messages.emojis["eximiabots"].replace(/[^0-9]+/g, '') }); interaction.reply({ diff --git a/src/client/commands/stop.ts b/src/client/commands/stop.ts index 92024c2..05c28d7 100644 --- a/src/client/commands/stop.ts +++ b/src/client/commands/stop.ts @@ -14,7 +14,7 @@ export default { const embed = new EmbedBuilder() .setTitle(client.user?.username || "-") - .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["stop"].replace(/[^0-9]+/g, '')) + .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messages.emojis["stop"].replace(/[^0-9]+/g, '')) .setColor(client.config.embedColor as ColorResolvable) .addFields({ name: client.messages.nowplayingTitle, @@ -23,7 +23,7 @@ export default { .setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png') .setFooter({ text: client.messages.footerText, - iconURL: "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '') + iconURL: "https://cdn.discordapp.com/emojis/" + client.messages.emojis["eximiabots"].replace(/[^0-9]+/g, '') }); if(!radio.message){ @@ -43,7 +43,7 @@ export default { client.radio?.delete(interaction.guild?.id); interaction.reply({ - content: client.messageEmojis["stop"] + client.messages.stop, + content: client.messages.emojis["stop"] + client.messages.stop, ephemeral: true }); } diff --git a/src/client/emojis.ts b/src/client/emojis.ts deleted file mode 100644 index b7cc2e0..0000000 --- a/src/client/emojis.ts +++ /dev/null @@ -1,44 +0,0 @@ -import RadioClient from "../Client"; - -export const emojis = { - name: 'emojis', - async execute(client: RadioClient): Promise { - let customEmojis: any = { - logo: "<:RadioX:688765708808487072>", - eximiabots: "<:EximiaBots:693277919929303132>", - list: "<:RadioXList:688541155519889482>", - play: "<:RadioXPlay:688541155712827458>", - stop: "<:RadioXStop:688541155377414168>", - statistics: "<:RadioXStatistics:694954485507686421>", - maintenance: "<:RadioXMaintenance:695043843057254493>", - error: "<:RadioXError:688541155792781320>", - prev: "<:RadioXPrev:882153637370023957>", - next: "<:RadioXNext:882153637474893834>" - }; - - let fallbackEmojis: any = { - logo: "RadioX", - eximiabots: "EximiaBots", - list: "📜", - play: "â–ļī¸", - stop: "⏚ī¸", - statistics: "📊", - maintenance: "🛠ī¸", - error: "❌", - prev: "âĒ", - next: "⏊" - }; - - client.messageEmojis = {}; - - for (const customEmojiName in customEmojis) { - const customEmojiID = customEmojis[customEmojiName].replace(/[^0-9]+/g, ''); - const customEmoji = client.emojis.cache.get(customEmojiID); - if (customEmoji) { - client.messageEmojis[customEmojiName] = customEmojis[customEmojiName]; - } else { - client.messageEmojis[customEmojiName] = fallbackEmojis[customEmojiName]; - } - } - } -} diff --git a/src/client/events/interactionCreate.ts b/src/client/events/interactionCreate.ts index 0f886b1..2762e45 100644 --- a/src/client/events/interactionCreate.ts +++ b/src/client/events/interactionCreate.ts @@ -7,7 +7,7 @@ export default { if(client.config.maintenanceMode){ return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.maintenance, + content: client.messages.emojis["error"] + client.messages.maintenance, ephemeral: true }); } @@ -16,7 +16,7 @@ export default { if (!permissions.has(PermissionFlagsBits.ViewChannel)) return; if (!permissions.has(PermissionFlagsBits.EmbedLinks)) return interaction.reply({ - content: client.messageEmojis["error"] + client.messages.noPermsEmbed, + content: client.messages.emojis["error"] + client.messages.noPermsEmbed, ephemeral: true }); @@ -29,7 +29,7 @@ export default { command.execute(interaction, client); } catch (error) { interaction.reply({ - content: client.messageEmojis["error"] + client.messages.runningCommandFailed, + content: client.messages.emojis["error"] + client.messages.runningCommandFailed, ephemeral: true }); console.error(error); @@ -43,7 +43,7 @@ export default { command.execute(interaction, client, command); } catch (error) { interaction.reply({ - content: client.messageEmojis["error"] + client.messages.runningCommandFailed, + content: client.messages.emojis["error"] + client.messages.runningCommandFailed, ephemeral: true }); console.error(error); diff --git a/src/client/events/ready.ts b/src/client/events/ready.ts index 128474b..efd0683 100644 --- a/src/client/events/ready.ts +++ b/src/client/events/ready.ts @@ -4,7 +4,6 @@ import Radio from "../classes/Radio"; import Stations from "../classes/Stations"; import Streamer from "../classes/Streamer"; import Statistics from "../classes/Statistics"; -import { emojis } from "../emojis" import commands from "../commands"; export default { @@ -65,9 +64,6 @@ export default { client.statistics = new Statistics(); client.statistics.calculateGlobal(client); - /*EMOJIS*/ - emojis.execute(client); - /*COMMANDS*/ commands.execute(client); diff --git a/src/client/funcs/check.ts b/src/client/funcs/check.ts index b20e452..8b89a5e 100644 --- a/src/client/funcs/check.ts +++ b/src/client/funcs/check.ts @@ -1,27 +1,26 @@ import RadioClient from "../../Client"; import { command } from "../commands"; - export default function check(client: RadioClient, interaction: any, command: command) { let message: any = {}; const radio = client.radio?.get(interaction.guild.id); if(!client.stations) { message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild); interaction.reply({ - content: client.messageEmojis["error"] + message.errorToGetPlaylist, + content: client.messages.emojis["error"] + message.errorToGetPlaylist, ephemeral: true }); return false; } if (!radio) { interaction.reply({ - content: client.messageEmojis["error"] + client.messages.notPlaying, + content: client.messages.emojis["error"] + client.messages.notPlaying, ephemeral: true }); return false; } if (interaction.member.voice.channel !== radio.voiceChannel) { interaction.reply({ - content: client.messageEmojis["error"] + client.messages.wrongVoiceChannel, + content: client.messages.emojis["error"] + client.messages.wrongVoiceChannel, ephemeral: true }); return false; diff --git a/src/client/funcs/play.ts b/src/client/funcs/play.ts index 6af87a0..f407b2b 100644 --- a/src/client/funcs/play.ts +++ b/src/client/funcs/play.ts @@ -16,7 +16,7 @@ export default async function play(client: RadioClient, interaction: any, guild: const embed = new EmbedBuilder() .setTitle(client.user?.username || "-") - .setThumbnail((radio.station.logo || "https://cdn.discordapp.com/emojis/" + client.messageEmojis["play"].replace(/[^0-9]+/g, ''))) + .setThumbnail((radio.station.logo || "https://cdn.discordapp.com/emojis/" + client.messages.emojis["play"].replace(/[^0-9]+/g, ''))) .setColor(client.config.embedColor as ColorResolvable) .addFields({ name: client.messages.nowplayingTitle, @@ -25,38 +25,38 @@ export default async function play(client: RadioClient, interaction: any, guild: .setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png') .setFooter({ text: client.messages.footerText, - iconURL: "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '') + iconURL: "https://cdn.discordapp.com/emojis/" + client.messages.emojis["eximiabots"].replace(/[^0-9]+/g, '') }); const buttons = new ActionRowBuilder() .addComponents( new ButtonBuilder() .setCustomId('list') - .setEmoji(client.messageEmojis["list"]) + .setEmoji(client.messages.emojis["list"]) .setStyle(ButtonStyle.Secondary) ) .addComponents( new ButtonBuilder() .setCustomId('prev') - .setEmoji(client.messageEmojis["prev"]) + .setEmoji(client.messages.emojis["prev"]) .setStyle(ButtonStyle.Secondary) ) .addComponents( new ButtonBuilder() .setCustomId('stop') - .setEmoji(client.messageEmojis["stop"]) + .setEmoji(client.messages.emojis["stop"]) .setStyle(ButtonStyle.Secondary) ) .addComponents( new ButtonBuilder() .setCustomId('next') - .setEmoji(client.messageEmojis["next"]) + .setEmoji(client.messages.emojis["next"]) .setStyle(ButtonStyle.Secondary) ) .addComponents( new ButtonBuilder() .setCustomId('statistics') - .setEmoji(client.messageEmojis["statistics"]) + .setEmoji(client.messages.emojis["statistics"]) .setStyle(ButtonStyle.Secondary) ); @@ -74,7 +74,7 @@ export default async function play(client: RadioClient, interaction: any, guild: message.play = client.messages.play.replace("%radio.station.name%", radio.station.name); interaction?.reply({ - content: client.messageEmojis["play"] + message.play, + content: client.messages.emojis["play"] + message.play, ephemeral: true }); diff --git a/src/client/messages.ts b/src/client/messages.ts index f9f4e11..b6231e1 100644 --- a/src/client/messages.ts +++ b/src/client/messages.ts @@ -35,5 +35,17 @@ export const messages = { statusField4: ":hourglass: Latency", statusField5: ":globe_with_meridians: Hosted by", errorStationURL: "Station can't be URL", - maintenance: "Shhhh... We are now sleeping and dreaming about new features to implement. Will be back soon." + maintenance: "Shhhh... We are now sleeping and dreaming about new features to implement. Will be back soon.", + emojis: { + logo: "<:RadioX:688765708808487072>", + eximiabots: "<:EximiaBots:693277919929303132>", + list: "<:RadioXList:688541155519889482>", + play: "<:RadioXPlay:688541155712827458>", + stop: "<:RadioXStop:688541155377414168>", + statistics: "<:RadioXStatistics:694954485507686421>", + maintenance: "<:RadioXMaintenance:695043843057254493>", + error: "<:RadioXError:688541155792781320>", + prev: "<:RadioXPrev:882153637370023957>", + next: "<:RadioXNext:882153637474893834>" + } };