Setting up other interactions

These are the other interactions aside from general slash commands. Such as button interaction when a button is clicked, or the select a option from a dropdown (autocomplete) or have a context menu open up when right-clicking a message, and lastly having a modal pop up in discord.

Testing required after Discord-features-handler v2, please try to use interactionReply instead!

module.exports = {
	name: 'ping',
	description: 'Ping Pong Command!',
	aliases: ['p'],
	guildOnly: true,
	permissions: 0,
	minArgs: 0, 
	customId: 'someButtonId',
	usage: '',
	execute(message, args, client) {
		return message.channel.send('Pong.');
	},
	async interactionReply(interaction) { // define what the slash command does
		await interaction.reply({
			content: 'Pong!'
		});
	}
	async buttonInteraction(interaction, client, level) {
	    //define what the interaction is when button is interacted with
	    await interaction.respond();
	}
};

Last updated