> For the complete documentation index, see [llms.txt](https://bng94.gitbook.io/discord-features-handler-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bng94.gitbook.io/discord-features-handler-docs/layout/setting-up-commands/setting-up-other-interactions.md).

# 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.

{% hint style="danger" %}
Testing required after Discord-features-handler v2, please try to use interactionReply instead!
{% endhint %}

{% tabs %}
{% tab title="isButton" %}

```
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();
	}
};
```

{% endtab %}

{% tab title="isAutocomplete" %}

```
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();
	}
};
```

{% endtab %}

{% tab title="isContextMenu" %}

```
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();
	}
};
```

{% endtab %}

{% tab title="isModalSubmit" %}

```javascript
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();
	}
};
```

{% endtab %}
{% endtabs %}
