#discord-api #discord #twilight

twilight-model

Discord API models for the Twilight ecosystem

91 releases

0.16.0-rc.1 Feb 21, 2024
0.15.4 Sep 10, 2023
0.15.2 Apr 27, 2023
0.15.1 Feb 26, 2023
0.2.4 Nov 29, 2020

#55 in Web programming

Download history 4317/week @ 2024-01-01 4651/week @ 2024-01-08 4319/week @ 2024-01-15 8315/week @ 2024-01-22 4893/week @ 2024-01-29 6767/week @ 2024-02-05 8140/week @ 2024-02-12 2338/week @ 2024-02-19 8941/week @ 2024-02-26 3477/week @ 2024-03-04 8134/week @ 2024-03-11 6876/week @ 2024-03-18 12111/week @ 2024-03-25 13510/week @ 2024-04-01 3449/week @ 2024-04-08 5478/week @ 2024-04-15

34,641 downloads per month
Used in 34 crates (31 directly)

ISC license

1.5MB
30K SLoC

twilight-model

codecov badge discord badge github badge license badge rust badge

See the twilight documentation for more information.

twilight-model is a crate of serde models defining the Discord APIs with few convenience methods on top of them.

These are in a single crate for ease of use, a single point of definition, and a sort of versioning of the Discord API. Similar to how a database schema progresses in versions, the definition of the API also progresses in versions.

The types in this crate are reproducible: deserializing a payload into a type, serializing it, and then deserializing it again will work.

Defined are a number of modules defining types returned by or owned by resource categories. For example, gateway are types used to interact with and returned by the gateway API. guild contains types owned by the Guild resource category. These types may be directly returned by, built on top of, or extended by other crates.

Some models have associated builders, which can be found in the twilight-util crate.

License

ISC

Dependencies

~1.4–2.2MB
~45K SLoC