Skip to content

Add application command (slash command) interaction support#136

Open
Levalicious wants to merge 1 commit intoCraftSpider:masterfrom
Levalicious:interactions
Open

Add application command (slash command) interaction support#136
Levalicious wants to merge 1 commit intoCraftSpider:masterfrom
Levalicious:interactions

Conversation

@Levalicious
Copy link
Copy Markdown

@Levalicious Levalicious commented Apr 9, 2026

  • Add make_interaction_data() to build valid INTERACTION_CREATE gateway payloads
  • Add FakeWebhookAdapter to intercept interaction responses (create_interaction_response, execute_webhook, edit_webhook_message, delete_webhook_message)
  • Add InteractionResponse data class with content/embeds/ephemeral/deferred
  • Add interaction() runner function analogous to message()
  • Add VerifyInteraction builder for asserting interaction responses
  • Add interaction_response callback event and queue
  • Fix _command_tree and __session linkage in configure()
  • Update run_all_events() to wait for CommandTree-invoker tasks
  • Export new APIs from __init__.py
  • Add 7 tests covering commands, options, ephemeral, embeds, verify

This is an AIslop PR I've been using to test out interactions for my bot. So far, it's been surprisingly usable. I don't expect this to get merged, but thought I'd toss over here for awareness in case someone finds it useful or wants to refine it. Feel free to use whatever portions you find useful for whatever reason.

Part of the reason it's AIslop is because I don't know how it should interact with the send queue. So if someone with a better understanding of the library has change suggestions, lmk.

Addresses #125

- Add make_interaction_data() to build valid INTERACTION_CREATE gateway payloads
- Add FakeWebhookAdapter to intercept interaction responses
  (create_interaction_response, execute_webhook, edit_webhook_message,
   delete_webhook_message)
- Add InteractionResponse data class with content/embeds/ephemeral/deferred
- Add interaction() runner function analogous to message()
- Add VerifyInteraction builder for asserting interaction responses
- Add interaction_response callback event and queue
- Fix _command_tree and __session linkage in configure()
- Update run_all_events() to wait for CommandTree-invoker tasks
- Export new APIs from __init__.py
- Add 7 tests covering commands, options, ephemeral, embeds, verify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant