From 8a10697edd32bd9dc078ebce80c8fe914a24ff93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 2 Sep 2021 12:08:19 +0300 Subject: [PATCH] Adding deprecation message when using message commands. --- src/client/events/messageCreate.js | 10 ++++++++++ src/client/messages.js | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/client/events/messageCreate.js b/src/client/events/messageCreate.js index 782042c..d69322a 100644 --- a/src/client/events/messageCreate.js +++ b/src/client/events/messageCreate.js @@ -27,8 +27,18 @@ module.exports = { const permissions = msg.channel.permissionsFor(msg.client.user); if (!permissions.has('EMBED_LINKS')) return msg.channel.send(client.messages.noPermsEmbed); try { + let message = {}; + message.messageCommandsDeprecatedTitle = client.messages.messageCommandsDeprecatedTitle.replace("%client.user.username%", client.user.username); + + const embed = new Discord.MessageEmbed() + .setTitle(message.messageCommandsDeprecatedTitle) + .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, '')) + .setColor(client.config.embedColor) + .setDescription(client.messages.messageCommandsDeprecatedDescription) + .setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '')); + msg.channel.send({ embeds: [embed] }); } catch (error) { msg.reply(client.messages.runningCommandFailed); console.error(error); diff --git a/src/client/messages.js b/src/client/messages.js index 9e44a11..0ce2a55 100644 --- a/src/client/messages.js +++ b/src/client/messages.js @@ -36,5 +36,7 @@ module.exports = { statusField3: "Uptime", statusField4: "Version", statusField5: "Hosted by", - errorStationURL: "Station can't be URL" + errorStationURL: "Station can't be URL", + messageCommandsDeprecatedTitle: "%client.user.username%", + messageCommandsDeprecatedDescription: "We recommend you to reauthorize our bot with clicking invite link because Discord is planning to remove message content from verified bots [Read More](https://support-dev.discord.com/hc/en-us/articles/4404772028055) \n\n **Invite Bot** \n https://wgi.fi/radiox_invite \n\n This bot is now supporting slash commands, you need to start to use them instead. Type / into message box in Discord and select bot you want to use. Remember to be careful because there are a few bugs here and there in Discord." }; \ No newline at end of file