mirror of
				https://github.com/warengroup/eximiabots-radiox.git
				synced 2025-10-31 07:11:35 +00:00 
			
		
		
		
	Updated interactionCreate event
This commit is contained in:
		| @@ -3,13 +3,28 @@ import Discord from "discord.js"; | ||||
| module.exports = { | ||||
|     name: 'interactionCreate', | ||||
|     async execute(client, interaction) { | ||||
|         if (!interaction.isCommand()) return; | ||||
|         /*if (!interaction.isCommand()) return;*/ | ||||
|  | ||||
|         const permissions = interaction.channel.permissionsFor(interaction.client.user); | ||||
|         if (!permissions.has('EMBED_LINKS')) return interaction.send(client.messages.noPermsEmbed); | ||||
|  | ||||
|         if(interaction.isCommand()){ | ||||
|             const commandName = interaction.commandName; | ||||
|             const command = client.commands.get(commandName); | ||||
|             if (!command) return; | ||||
|         const permissions = interaction.channel.permissionsFor(interaction.client.user); | ||||
|         if (!permissions.has('EMBED_LINKS')) return interaction.send(client.messages.noPermsEmbed); | ||||
|      | ||||
|             try { | ||||
|                 command.execute(interaction, client, Discord, command); | ||||
|             } catch (error) { | ||||
|                 interaction.reply(client.messages.runningCommandFailed); | ||||
|                 console.error(error); | ||||
|             } | ||||
|         } else if (interaction.isSelectMenu()){ | ||||
|  | ||||
|         } else if (interaction.isButton()){ | ||||
|             const commandName = interaction.customId; | ||||
|             const command = client.commands.get(commandName); | ||||
|             if (!command) return; | ||||
|      | ||||
|             try { | ||||
|                 command.execute(interaction, client, Discord, command); | ||||
| @@ -18,4 +33,5 @@ module.exports = { | ||||
|                 console.error(error); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Christer Warén
					Christer Warén