![ci-img] ![cio-img] ![lic-img] ![doc-img]
This library provides types and helper functions for handling Discord's Interactions. It also provides an actix-web backend handler system to handle Interactions through your own API (instead of using the gateway).
To install this library, add this dependency entry to your Cargo.toml
file:
toml
rusty_interaction = "0"
By default, this only exposes the types and security check function. If you want to use the handler, add the following to your Cargo.toml
:
toml
[dependencies.rusty_interaction]
version = "0"
features = ["handler"]
Take a look at the documentation and the examples to get yourself familiar with using the library.
Please take a look at the following examples: - Basic HTTP handler - Basic HTTPS handler
More than welcome! :D
crate::security::verify_discord_message()
)The gateway requires you to have a discord client where you receive interactions.
Setting up your own endpoint makes Discord send the interactions to your own API endpoint (ex. https://example.com/api/discord/interactions
).
If you already have an API that runs your service and you're looking to integrate with Discord, this way of receiving interactions can be really interesting.
One distinct difference is that you do not need a bot or oauth token for most features. Some features (like command management) do require a bot token.
No. If you want to receive interactions through the gateway, you want to take a look at Serenity or one of the other libraries.