📄
Discord Features Handler Docs
  • discord-features-handler documentation
  • Getting Started
    • Quick Start
    • Environment Variables
    • DiscordFeaturesHandler Setup
  • Layout
    • Folder Structure
    • Setting up Commands
      • Setting up Slash Commands
      • Setting up other interactions
    • Setting up Events
  • Built-in
    • Disabling Built-in Commands and Events
    • Built-in Functions
    • Built-in config.js file
    • Built-in Customizable Commands
      • Built-in Help Command
      • Built-in Reload Command
    • Built-in Customizable Events
      • Built-in MessageCreate Event
      • Built-in interactionCreate Event
  • References
    • Roadmap
    • ChangeLog
Powered by GitBook
On this page
  1. Layout
  2. Setting up Commands

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();
	}
};
module.exports = {
	name: 'ping',
	description: 'Ping Pong Command!',
	aliases: ['p'],
	guildOnly: true,
	permissions: 0,
	minArgs: 0, 
	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 autoCompleteInteraction(interaction, client, level) {
	    //define what the interaction is when autoComplete is interacted with
	    await interaction.respond();
	}
};
module.exports = {
	name: 'ping',
	description: 'Ping Pong Command!',
	aliases: ['p'],
	guildOnly: true,
	permissions: 0,
	minArgs: 0, 
	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 contextMenuInteraction(interaction, client, level) {
	    //define what the interaction is when context menu is interacted with
	    await interaction.respond();
	}
};
module.exports = {
	name: 'ping',
	description: 'Ping Pong Command!',
	aliases: ['p'],
	guildOnly: true,
	permissions: 0,
	minArgs: 0, 
	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 modalInteraction(interaction, client, level) {
	    //define what the interaction is when autoComplete is interacted with
	    await interaction.respond();
	}
};
PreviousSetting up Slash CommandsNextSetting up Events

Last updated 1 year ago