mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-02 12:43:36 +00:00
Discord.js V14 compatibility
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
module.exports = function check(client, interaction, command) {
|
||||
let message = {};
|
||||
const radio = client.radio.get(interaction.guild.id);
|
||||
const permissions = interaction.channel.permissionsFor(interaction.user);
|
||||
if(client.config.maintenanceMode){
|
||||
interaction.reply({
|
||||
content: client.messageEmojis["error"] + client.messages.maintenance,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Discord from "discord.js";
|
||||
import { ActionRowBuilder, SelectMenuBuilder } from "discord.js";
|
||||
|
||||
module.exports = function listStations(client, interaction){
|
||||
let stations = new Array();
|
||||
@ -14,9 +14,9 @@ module.exports = function listStations(client, interaction){
|
||||
options.push(station);
|
||||
});
|
||||
|
||||
const menu = new Discord.MessageActionRow()
|
||||
const menu = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new Discord.MessageSelectMenu()
|
||||
new SelectMenuBuilder()
|
||||
.setCustomId('play')
|
||||
.setPlaceholder('Nothing selected')
|
||||
.addOptions(options)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Discord from "discord.js";
|
||||
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder } from "discord.js";
|
||||
|
||||
module.exports = async function play(client, interaction, guild, station) {
|
||||
let message = {};
|
||||
@ -13,47 +13,50 @@ module.exports = async function play(client, interaction, guild, station) {
|
||||
message.nowplayingDescription = message.nowplayingDescription.replace("**", "");
|
||||
message.nowplayingDescription = message.nowplayingDescription.replace("**", "");
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(client.user.username)
|
||||
.setThumbnail((radio.station.logo || "https://cdn.discordapp.com/emojis/" + client.messageEmojis["play"].replace(/[^0-9]+/g, '')))
|
||||
.setColor(client.config.embedColor)
|
||||
.addField(client.messages.nowplayingTitle, message.nowplayingDescription, true)
|
||||
.addFields({
|
||||
name: client.messages.nowplayingTitle,
|
||||
value: message.nowplayingDescription
|
||||
})
|
||||
.setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png')
|
||||
.setFooter({
|
||||
text: client.messages.footerText,
|
||||
iconURL: "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '')
|
||||
});
|
||||
|
||||
const buttons = new Discord.MessageActionRow()
|
||||
const buttons = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new Discord.MessageButton()
|
||||
new ButtonBuilder()
|
||||
.setCustomId('list')
|
||||
.setEmoji(client.messageEmojis["list"])
|
||||
.setStyle('SECONDARY')
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
)
|
||||
.addComponents(
|
||||
new Discord.MessageButton()
|
||||
new ButtonBuilder()
|
||||
.setCustomId('prev')
|
||||
.setEmoji(client.messageEmojis["prev"])
|
||||
.setStyle('SECONDARY')
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
)
|
||||
.addComponents(
|
||||
new Discord.MessageButton()
|
||||
new ButtonBuilder()
|
||||
.setCustomId('stop')
|
||||
.setEmoji(client.messageEmojis["stop"])
|
||||
.setStyle('SECONDARY')
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
)
|
||||
.addComponents(
|
||||
new Discord.MessageButton()
|
||||
new ButtonBuilder()
|
||||
.setCustomId('next')
|
||||
.setEmoji(client.messageEmojis["next"])
|
||||
.setStyle('SECONDARY')
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
)
|
||||
.addComponents(
|
||||
new Discord.MessageButton()
|
||||
new ButtonBuilder()
|
||||
.setCustomId('statistics')
|
||||
.setEmoji(client.messageEmojis["statistics"])
|
||||
.setStyle('SECONDARY')
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
);
|
||||
|
||||
if(!radio.message){
|
||||
|
Reference in New Issue
Block a user