Add choices support to slash command options, ephemeral support to Message - #33
Open
lmiquel wants to merge 2 commits into
Open
Add choices support to slash command options, ephemeral support to Message#33lmiquel wants to merge 2 commits into
lmiquel wants to merge 2 commits into
Conversation
Author
|
Btw, I'm very new to gleam. Lmk if I made any mistakes please :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small, additive changes — nothing existing breaks, gleam test still green:
CommandOptiongets a new choices: List(#(String, String)) field. When non-empty, it's serialized as the choices array Discord's API expects ([{"name": ..., "value": ...}]), turning a string/int option into a dropdown instead of free text. An empty list keeps the current behavior exactly (the choices key is omitted entirely).Messagegets a new ephemeral: Bool field (plus set_ephemeral), serialized as the 64 flag. Right now there's no way to send an ephemeral response or followup — useful when you want a warning visible only to the interaction's caller, e.g. alongside an already-deferred main reply.Both came out of building a real bot: a Docker control bot where /start /stop /restart need a dropdown to pick a service, and /stop sends an ephemeral follow-up warning for certain services.