Changed interaction replies to ephemeral in commands

This commit is contained in:
Christer Warén 2021-09-06 14:42:49 +03:00
parent c673ae27f6
commit f9d195788c
4 changed files with 24 additions and 6 deletions

View File

@ -9,7 +9,10 @@ module.exports = {
let message = {}; let message = {};
if(!client.stations) { if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild); 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); const radio = client.radio.get(interaction.guild.id);

View File

@ -11,7 +11,10 @@ module.exports = {
async execute(interaction, client) { async execute(interaction, client) {
let message = {}; 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]; let action = interaction.options?.getNumber("action") ?? interaction.values?.[0];
const options = new Array( const options = new Array(
{ {

View File

@ -43,10 +43,16 @@ module.exports = {
if (!query) return interaction.reply(client.messages.noQuery); if (!query) return interaction.reply(client.messages.noQuery);
const permissions = voiceChannel.permissionsFor(interaction.client.user); const permissions = voiceChannel.permissionsFor(interaction.client.user);
if (!permissions.has("CONNECT")) { 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")) { 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; let station;
const number = parseInt(query - 1); const number = parseInt(query - 1);
@ -129,7 +135,10 @@ module.exports = {
} catch (error) { } catch (error) {
console.log(error); console.log(error);
client.radio.delete(interaction.guild.id); 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
});
} }
} }
}; };

View File

@ -15,7 +15,10 @@ module.exports = {
if(!client.stations) { if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild); 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){ if(!currentGuild || currentGuild && !currentGuild.statistics){