Crates.io | twilight-interactions-derive |
lib.rs | twilight-interactions-derive |
version | 0.16.0-rc.1 |
source | src |
created_at | 2021-10-28 17:11:24.138865 |
updated_at | 2024-05-16 00:26:15.736622 |
description | Macros and utilities to make Discord Interactions easy to use with Twilight. |
homepage | https://github.com/baptiste0928/twilight-interactions#readme |
repository | https://github.com/baptiste0928/twilight-interactions |
max_upload_size | |
id | 473632 |
size | 70,307 |
twilight-interactions
is a set of macros and utilities to work with Discord Interactions using twilight
.
Note: This crate is not affiliated with the twilight
project.
CommandModel
macro.CreateCommand
macro. Commands are configured using attributes.use twilight_interactions::command::{CommandModel, CreateCommand, ResolvedUser};
#[derive(CommandModel, CreateCommand)]
#[command(name = "hello", desc = "Say hello to other members")]
struct HelloCommand {
/// Message to send
message: String,
/// User to send the message to
user: Option<ResolvedUser>
}
To install twilight-interactions
, add the following to your Cargo.toml
:
[dependencies]
twilight-interactions = "0.15"
The crate's major version follows the version of the official twilight crates.
The current MSRV is 1.67
.
The API documentation is available on docs.rs: twilight-interactions
documentation.
Examples are available in the examples
directory.
There is no particular contribution guidelines, feel free to open a new PR to improve the code. If you want to introduce a new feature, please create an issue before.
Special thanks to LeSeulArtichaut who worked the first on this project.