From f9d195788c5e7b7fc1229d07e27cb2cd4903f644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Mon, 6 Sep 2021 14:42:49 +0300 Subject: [PATCH] Changed interaction replies to ephemeral in commands --- src/client/commands/list.js | 5 ++++- src/client/commands/maintenance.js | 5 ++++- src/client/commands/play.js | 15 ++++++++++++--- src/client/commands/statistics.js | 5 ++++- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/client/commands/list.js b/src/client/commands/list.js index b0ce3fd..b89772e 100644 --- a/src/client/commands/list.js +++ b/src/client/commands/list.js @@ -9,7 +9,10 @@ module.exports = { let message = {}; if(!client.stations) { message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild); - return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist); + return interaction.reply({ + content: client.messageEmojis["error"] + message.errorToGetPlaylist, + ephemeral: true + }); } const radio = client.radio.get(interaction.guild.id); diff --git a/src/client/commands/maintenance.js b/src/client/commands/maintenance.js index b76af77..111e04d 100644 --- a/src/client/commands/maintenance.js +++ b/src/client/commands/maintenance.js @@ -11,7 +11,10 @@ module.exports = { async execute(interaction, client) { let message = {}; - if(!client.funcs.isDev(client.config.devId, interaction.user.id)) return interaction.reply(client.messageEmojis["error"] + client.messages.notAllowed); + if(!client.funcs.isDev(client.config.devId, interaction.user.id)) return interaction.reply({ + content: client.messageEmojis["error"] + client.messages.notAllowed, + ephemeral: true + }); let action = interaction.options?.getNumber("action") ?? interaction.values?.[0]; const options = new Array( { diff --git a/src/client/commands/play.js b/src/client/commands/play.js index 3384238..7b996e0 100644 --- a/src/client/commands/play.js +++ b/src/client/commands/play.js @@ -43,10 +43,16 @@ module.exports = { if (!query) return interaction.reply(client.messages.noQuery); const permissions = voiceChannel.permissionsFor(interaction.client.user); if (!permissions.has("CONNECT")) { - return interaction.reply(client.messageEmojis["error"] + client.messages.noPermsConnect); + return interaction.reply({ + content: client.messageEmojis["error"] + client.messages.noPermsConnect, + ephemeral: true + }); } if (!permissions.has("SPEAK")) { - return interaction.reply(client.messageEmojis["error"] + client.messages.noPermsSpeak); + return interaction.reply({ + content: client.messageEmojis["error"] + client.messages.noPermsSpeak, + ephemeral: true + }); } let station; const number = parseInt(query - 1); @@ -129,7 +135,10 @@ module.exports = { } catch (error) { console.log(error); client.radio.delete(interaction.guild.id); - return interaction.reply(client.messageEmojis["error"] + `An error occured: ${error}`); + return interaction.reply({ + content: client.messageEmojis["error"] + `An error occured: ${error}`, + ephemeral: true + }); } } }; \ No newline at end of file diff --git a/src/client/commands/statistics.js b/src/client/commands/statistics.js index 7e87510..d9ba2fe 100644 --- a/src/client/commands/statistics.js +++ b/src/client/commands/statistics.js @@ -15,7 +15,10 @@ module.exports = { if(!client.stations) { message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild); - return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist); + return interaction.reply({ + content: client.messageEmojis["error"] + message.errorToGetPlaylist, + ephemeral: true + }); } if(!currentGuild || currentGuild && !currentGuild.statistics){