mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-03 03:44:31 +00:00
Discord.js V14 compatibility
This commit is contained in:
@ -1,16 +1,18 @@
|
||||
import { PermissionFlagsBits } from "discord.js";
|
||||
|
||||
module.exports = {
|
||||
name: 'interactionCreate',
|
||||
async execute(client, interaction) {
|
||||
|
||||
const permissions = interaction.channel.permissionsFor(interaction.client.user);
|
||||
if (!permissions.has('VIEW_CHANNEL')) return;
|
||||
if (!permissions.has(PermissionFlagsBits.ViewChannel)) return;
|
||||
|
||||
if (!permissions.has('EMBED_LINKS')) return interaction.reply({
|
||||
if (!permissions.has(PermissionFlagsBits.EmbedLinks)) return interaction.reply({
|
||||
content: client.messageEmojis["error"] + client.messages.noPermsEmbed,
|
||||
ephemeral: true
|
||||
});
|
||||
|
||||
if(interaction.isCommand()){
|
||||
if(interaction.isChatInputCommand()){
|
||||
const commandName = interaction.commandName;
|
||||
const command = client.commands.get(commandName);
|
||||
if (!command) return;
|
||||
|
@ -1,4 +1,5 @@
|
||||
import Discord from "discord.js";
|
||||
import { EmbedBuilder, PermissionFlagsBits } from "discord.js";
|
||||
|
||||
module.exports = {
|
||||
name: 'messageCreate',
|
||||
async execute(client, message) {
|
||||
@ -25,13 +26,13 @@ module.exports = {
|
||||
const command = client.commands.get(commandName) || client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));
|
||||
if (!command && message.content !== `${prefix}`) return;
|
||||
const permissions = message.channel.permissionsFor(message.client.user);
|
||||
if (!permissions.has('EMBED_LINKS')) return message.channel.send(client.messages.noPermsEmbed);
|
||||
if (!permissions.has(PermissionFlagsBits.EmbedLinks)) return message.channel.send(client.messages.noPermsEmbed);
|
||||
try {
|
||||
let newMessage = {};
|
||||
|
||||
newMessage.messageCommandsDeprecatedTitle = client.messages.messageCommandsDeprecatedTitle.replace("%client.user.username%", client.user.username);
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(newMessage.messageCommandsDeprecatedTitle)
|
||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, ''))
|
||||
.setColor(client.config.embedColor)
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { PermissionFlagsBits } from "discord.js";
|
||||
const {
|
||||
getVoiceConnection,
|
||||
joinVoiceChannel
|
||||
@ -22,7 +23,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
const newPermissions = newState.channel.permissionsFor(newState.client.user);
|
||||
if (!newPermissions.has("CONNECT") || !newPermissions.has("SPEAK") || !newPermissions.has("VIEW_CHANNEL")) {
|
||||
if (!newPermissions.has(PermissionFlagsBits.Connect) || !newPermissions.has(PermissionFlagsBits.Speak) || !newPermissions.has(PermissionFlagsBits.ViewChannel)) {
|
||||
try {
|
||||
setTimeout(
|
||||
async () => (
|
||||
|
Reference in New Issue
Block a user