Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4: Add interaction router #339

Open
diamondburned opened this issue Aug 20, 2022 · 0 comments
Open

v4: Add interaction router #339

diamondburned opened this issue Aug 20, 2022 · 0 comments
Milestone

Comments

@diamondburned
Copy link
Owner

This issue proposes a new package utils/interactions which supplies an interactions.Router that the user can use. The router should be used vaguely like so:

r := interactions.NewRouter() // composes CommandRouter
r.Use(interactions.WithDeferAfter(2 * time.Second)) // automatically defer responses
r.Modal("verify-response", func(data *interactions.ModalEvent) {
    time.Sleep(5 * time.Second)
    data.RespondMessage(api.InteractionResponseData{ /* TODO */ })
})
r.Button("button-press", func(press *interactions.ButtonEvent) {
    press.RespondMessage(...)
})
r.Subcommand("member", func(r *interactions.CommandRouter) {
    r.Command("query", h.queryMember)
})
r.Command("query-member", h.queryMember)

// TODO: API draft

@diamondburned diamondburned changed the title v3: Add interaction router v4: Add interaction router Oct 13, 2022
@diamondburned diamondburned added this to the v4 milestone Oct 13, 2022
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

No branches or pull requests

1 participant