mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-01 07:43:38 +00:00
Discord.js V14 compatibility
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import Discord from "discord.js";
|
||||
import { EmbedBuilder } from "discord.js";
|
||||
|
||||
module.exports = {
|
||||
name: 'bug',
|
||||
@ -10,7 +10,7 @@ module.exports = {
|
||||
message.bugTitle = client.messages.bugTitle.replace("%client.user.username%", client.user.username);
|
||||
message.bugDescription = client.messages.bugDescription.replace("%client.config.supportGuild%", client.config.supportGuild);
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(message.bugTitle)
|
||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, ''))
|
||||
.setColor(client.config.embedColor)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Discord from "discord.js";
|
||||
import { EmbedBuilder } from "discord.js";
|
||||
|
||||
module.exports = {
|
||||
name: 'invite',
|
||||
@ -7,7 +7,7 @@ module.exports = {
|
||||
execute(interaction, client) {
|
||||
let message = {};
|
||||
message.inviteTitle = client.messages.inviteTitle.replace("%client.user.username%", client.user.username);
|
||||
const embed = new Discord.MessageEmbed()
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(message.inviteTitle)
|
||||
.setColor(client.config.embedColor)
|
||||
.setURL("https://discord.com/api/oauth2/authorize?client_id=" + client.user.id + "&permissions=2184465408&scope=applications.commands%20bot") //View Channels, Send Messages, Embed Links, Use External Emojis, Use Slash Commands, Connect, Speak, Use Voice Activity
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Discord from "discord.js";
|
||||
import { EmbedBuilder } from "discord.js";
|
||||
|
||||
module.exports = {
|
||||
name: 'list',
|
||||
@ -26,7 +26,7 @@ module.exports = {
|
||||
stations = stations.replace('**#**', `**${i + 1}.**`);
|
||||
}
|
||||
|
||||
let embed = new Discord.MessageEmbed()
|
||||
let embed = new EmbedBuilder()
|
||||
.setTitle(client.messages.listTitle)
|
||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["list"].replace(/[^0-9]+/g, ''))
|
||||
.setColor(client.config.embedColor)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Discord from "discord.js";
|
||||
import { ActionRowBuilder, EmbedBuilder, SelectMenuBuilder } from "discord.js";
|
||||
import Streamer from "../classes/Streamer.js";
|
||||
const _importDynamic = new Function('modulePath', 'return import(modulePath)');
|
||||
const fetch = (...args) => _importDynamic('node-fetch').then(({default: fetch}) => fetch(...args));
|
||||
@ -72,9 +72,9 @@ module.exports = {
|
||||
}
|
||||
);
|
||||
|
||||
const menu = new Discord.MessageActionRow()
|
||||
const menu = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new Discord.MessageSelectMenu()
|
||||
new SelectMenuBuilder()
|
||||
.setCustomId('maintenance')
|
||||
.setPlaceholder('Select action')
|
||||
.addOptions(options)
|
||||
@ -90,7 +90,7 @@ module.exports = {
|
||||
|
||||
client.funcs.logger('Maintenance', options.find(option => option.value == action).label);
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(client.messages.maintenanceTitle)
|
||||
.setColor(client.config.embedColor)
|
||||
.setDescription(options.find(option => option.value == action).label)
|
||||
|
@ -23,7 +23,7 @@ module.exports = {
|
||||
radio.textChannel = interaction.channel;
|
||||
radio.startTime = date.getTime();
|
||||
|
||||
if(interaction.isCommand()) {
|
||||
if(interaction.isChatInputCommand()) {
|
||||
client.funcs.play(client, interaction, interaction.guild, station);
|
||||
}
|
||||
if(interaction.isButton()) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Discord from "discord.js";
|
||||
import { EmbedBuilder } from "discord.js";
|
||||
|
||||
module.exports = {
|
||||
name: 'nowplaying',
|
||||
@ -18,7 +18,7 @@ module.exports = {
|
||||
message.nowplayingDescription = message.nowplayingDescription.replace("%radio.station.owner%" + "\n", radio.station.name != radio.station.owner ? radio.station.owner + "\n" : "");
|
||||
message.nowplayingDescription = message.nowplayingDescription.replace("%client.funcs.msToTime(completed)%", client.funcs.msToTime(completed));
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(client.messages.nowplayingTitle)
|
||||
.setThumbnail((radio.station.logo || "https://cdn.discordapp.com/emojis/" + client.messageEmojis["play"].replace(/[^0-9]+/g, '')))
|
||||
.setColor(client.config.embedColor)
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { PermissionFlagsBits } from "discord.js";
|
||||
const {
|
||||
getVoiceConnection,
|
||||
joinVoiceChannel
|
||||
@ -51,13 +52,13 @@ module.exports = {
|
||||
ephemeral: true
|
||||
});
|
||||
const permissions = voiceChannel.permissionsFor(interaction.client.user);
|
||||
if (!permissions.has("CONNECT")) {
|
||||
if (!permissions.has(PermissionFlagsBits.Connect)) {
|
||||
return interaction.reply({
|
||||
content: client.messageEmojis["error"] + client.messages.noPermsConnect,
|
||||
ephemeral: true
|
||||
});
|
||||
}
|
||||
if (!permissions.has("SPEAK")) {
|
||||
if (!permissions.has(PermissionFlagsBits.Speak)) {
|
||||
return interaction.reply({
|
||||
content: client.messageEmojis["error"] + client.messages.noPermsSpeak,
|
||||
ephemeral: true
|
||||
|
@ -23,7 +23,7 @@ module.exports = {
|
||||
radio.textChannel = interaction.channel;
|
||||
radio.startTime = date.getTime();
|
||||
|
||||
if(interaction.isCommand()) {
|
||||
if(interaction.isChatInputCommand()) {
|
||||
client.funcs.play(client, interaction, interaction.guild, station);
|
||||
}
|
||||
if(interaction.isButton()) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Discord from "discord.js";
|
||||
import { EmbedBuilder } from "discord.js";
|
||||
|
||||
|
||||
module.exports = {
|
||||
@ -26,7 +26,7 @@ module.exports = {
|
||||
statistics = "[Open Dashboard](https://eximiabots.waren.io/radiox/" + interaction.guild.id + "/stats?info=" + Buffer.from(JSON.stringify(currentGuild), 'utf8').toString('base64') + "&globalInfo=" + Buffer.from(JSON.stringify(global), 'utf8').toString('base64') + ")" + "\n";
|
||||
}
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(client.messages.statisticsTitle)
|
||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["statistics"].replace(/[^0-9]+/g, ''))
|
||||
.setColor(client.config.embedColor)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Discord from "discord.js";
|
||||
import { EmbedBuilder } from "discord.js";
|
||||
|
||||
module.exports = {
|
||||
name: 'status',
|
||||
@ -10,15 +10,17 @@ module.exports = {
|
||||
message.statusTitle = client.messages.statusTitle.replace("%client.user.username%", client.user.username);
|
||||
let uptime = client.funcs.msToTime(client.uptime);
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(message.statusTitle)
|
||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, ''))
|
||||
.setColor(client.config.embedColor)
|
||||
.addField(client.messages.statusField1, uptime, false)
|
||||
.addField(client.messages.statusField2, client.config.version, false)
|
||||
.addField(client.messages.statusField3, Date.now() - interaction.createdTimestamp + "ms", false)
|
||||
.addField(client.messages.statusField4, client.ws.ping + "ms", false)
|
||||
.addField(client.messages.statusField5, client.config.hostedBy, false)
|
||||
.addFields(
|
||||
{ name: client.messages.statusField1, value: uptime },
|
||||
{ name: client.messages.statusField2, value: client.config.version },
|
||||
{ name: client.messages.statusField3, value: Date.now() - interaction.createdTimestamp + "ms" },
|
||||
{ name: client.messages.statusField4, value: client.ws.ping },
|
||||
{ name: client.messages.statusField5, value: client.config.hostedBy },
|
||||
)
|
||||
.setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png')
|
||||
.setFooter({
|
||||
text: client.messages.footerText,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Discord from "discord.js";
|
||||
import { EmbedBuilder } from "discord.js";
|
||||
|
||||
module.exports = {
|
||||
name: 'stop',
|
||||
@ -11,11 +11,14 @@ module.exports = {
|
||||
radio.connection?.destroy();
|
||||
client.funcs.logger('Radio', interaction.guild.id + " / " + 'Stop');
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(client.user.username)
|
||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["stop"].replace(/[^0-9]+/g, ''))
|
||||
.setColor(client.config.embedColor)
|
||||
.addField(client.messages.nowplayingTitle, "-", true)
|
||||
.addFields({
|
||||
name: client.messages.nowplayingTitle,
|
||||
value: "-"
|
||||
})
|
||||
.setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png')
|
||||
.setFooter({
|
||||
text: client.messages.footerText,
|
||||
|
Reference in New Issue
Block a user