Poll Discussion & Answers
1️⃣ → Interaction Handler
2️⃣ → In the command with the same name / id
3️⃣ → Other (please explain in thread)
39 Replies
sorry, what's the interaction handler?
Vlad Frangu's Notion on Notion
Handling Interactions (not Application Commands) in Sapphire
For a long time, the demand for interaction handlers in Sapphire has grown exponentially with time! The good news is that I finally have something to show you, and I think this will allow for some super clean code on your side!
Wow I was gonna vote interaction handler but I'm being mega outvoted so far. Maybe I just don't grasp autocomplete properly yet.
you can vote that if you want
Yeah I know of course
the TL;DR is: autocompletes are currently for chat input string/number args
I was first going to vote (2) but I didn't know/remember what (1) was
I just think it would be more readable to have a very relevant handler in the class
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
Hmm
Discord Developer Portal
Discord Developer Portal — API Docs for Bots and Developers
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
It's for the autocomplete interactions, where if you have an argument that can return completions based on input, where should it go, in the same command class or elsewhere
I did 3 cause I want to kinda support both, I can understand in command handling for ease of use, but more generic ones (like auto complete on usernames??) you want those on a simple handler so you don't redo code
My worry is that cramming it in the command class will make it..messy
but if I had 1 choice, I'd choose 2
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
https://twitter.com/advaithj1/status/1441562341632458754?s=21 this is auto complete in action
advaith (@advaithj1)
AdvaithBot, Slashtags, and Dictionary now support autocomplete, one of the new features shown during Thursday's DDevs stage event!
Twitter
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
Both will be code chaos
I kinda don't want just 2 to win
lol
I mean I would make it support both but then you end up with.. "have I replied in the command class..or in the interaction handler...do i handle both???"
Also there is an autocomplete Notion from snek: https://devsnek.notion.site/devsnek/Application-Command-Option-Autocomplete-Interactions-dacc980320c948768cec5ae3a96a5886
snek's Notion on Notion
Application Command Option Autocomplete Interactions
At present applications must pre-define all possible options when accepting input from users. We want to enable applications to dynamically populate options in slash commands, which would allow for more use-cases (like building a simple search or supporting many choices).
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
if in command exists -> command, else handler
command first, then handler
HMMMMMMMM
require both
Intriguing
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
do it both ways. Have it call the same function or smth
This could be a way to do it, not my favorite at all but definitely cleaner than I thought
Makes sense I suppose, freedom of choice and all
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
I just want to avoid possible "you shot yourself in the foot, what did you expect to happen"
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
It's either that or define it
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
See pins
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Interaction handlers are their own piece that let you handle any interactions that aren't command ones