mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-04-19 07:24:48 +00:00
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
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) {
|
|
interaction.reply({
|
|
content: client.messages.emojis["error"] + client.messages.replace(client.messages.errorToGetPlaylist, {
|
|
"%client.config.supportGuild%": client.config.supportGuild
|
|
}),
|
|
ephemeral: true
|
|
});
|
|
return false;
|
|
}
|
|
if (!radio) {
|
|
interaction.reply({
|
|
content: client.messages.emojis["error"] + client.messages.notPlaying,
|
|
ephemeral: true
|
|
});
|
|
return false;
|
|
}
|
|
if (interaction.member.voice.channel !== radio.voiceChannel) {
|
|
interaction.reply({
|
|
content: client.messages.emojis["error"] + client.messages.wrongVoiceChannel,
|
|
ephemeral: true
|
|
});
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
};
|