Interactions handling
Learn how to effectively manage interactions between your bot and users using Sunar. From responding to slash commands, context menu clicks, button presses, to select menu choices, Sunar offers robust mechanisms to handle diverse interactions within Discord.
Handle all supported interactions
This setup configures Sunar to efficiently manage various Discord interactions using a Signal
named interactionCreate
. It prepares the framework to handle incoming events such as slash commands, buttons, and other interactions initiated by users in Discord.
Handle only specific interactions
This configuration sets up Sunar to selectively manage and respond to specific types of Discord interactions based on their nature, such as slash commands, context menu commands, buttons, modals, select menus, and autocomplete commands.
This setup allows your bot to efficiently manage and respond to specific interaction types on Discord, ensuring accurate and timely responses tailored to the user's actions. Customize the handling logic within each handler function (handleSlash
, handleContextMenu
, etc.) as needed to implement your bot's functionality and interaction flow according to Discord's API capabilities and user experience requirements.
Last updated on