mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2026-11-03 11:15:05 +00:00
TypeScript Initial
This commit is contained in:
1 parent
4d18468e96
commit
56f0ab5a40
39 files changed
+24
-30
No files matched your search
@@ -0,0 +1,36 @@
|
||||
module.exports = {
|
||||
name: 'prev',
|
||||
description: 'Previous Station',
|
||||
category: 'radio',
|
||||
async execute(interaction, client, command) {
|
||||
if (client.funcs.check(client, interaction, command)) {
|
||||
const radio = client.radio.get(interaction.guild.id);
|
||||
|
||||
let index = client.stations.findIndex(station => station.name == radio.station.name) - 1;
|
||||
if(index == -1) index = client.stations.length - 1;
|
||||
|
||||
let station = client.stations[index];
|
||||
|
||||
if(!station) return interaction.reply({
|
||||
content: client.messageEmojis["error"] + client.messages.noSearchResults,
|
||||
ephemeral: true
|
||||
});
|
||||
|
||||
client.statistics.update(client, interaction.guild, radio);
|
||||
|
||||
let date = new Date();
|
||||
radio.station = station;
|
||||
radio.textChannel = interaction.channel;
|
||||
radio.startTime = date.getTime();
|
||||
|
||||
if(interaction.isChatInputCommand()) {
|
||||
client.funcs.play(client, interaction, interaction.guild, station);
|
||||
}
|
||||
if(interaction.isButton()) {
|
||||
interaction.deferUpdate();
|
||||
client.funcs.play(client, null, interaction.guild, station);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user