mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-23 01:13:17 +00:00
Updated play command
This commit is contained in:
parent
9303dd1c19
commit
aa715aaafa
@ -15,14 +15,14 @@ module.exports = {
|
|||||||
category: "radio",
|
category: "radio",
|
||||||
async execute(interaction, client) {
|
async execute(interaction, client) {
|
||||||
let message = {};
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
let query = interaction.options?.getString("query") ?? interaction.values?.[0];
|
let query = interaction.options?.getString("query") ?? interaction.values?.[0];
|
||||||
if(!query){
|
if(!query){
|
||||||
if(!client.stations) {
|
return client.funcs.listStations(client, interaction);
|
||||||
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
|
|
||||||
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
|
|
||||||
}
|
|
||||||
|
|
||||||
client.funcs.listStations(client, interaction);
|
|
||||||
}
|
}
|
||||||
let url = query ? query.replace(/<(.+)>/g, "$1") : "";
|
let url = query ? query.replace(/<(.+)>/g, "$1") : "";
|
||||||
const radio = client.radio.get(interaction.guild.id);
|
const radio = client.radio.get(interaction.guild.id);
|
||||||
@ -40,16 +40,6 @@ module.exports = {
|
|||||||
ephemeral: true
|
ephemeral: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!client.stations) {
|
|
||||||
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace(
|
|
||||||
"%client.config.supportGuild%",
|
|
||||||
client.config.supportGuild
|
|
||||||
);
|
|
||||||
return interaction.reply({
|
|
||||||
content: client.messageEmojis["error"] + message.errorToGetPlaylist,
|
|
||||||
ephemeral: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
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")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user