#discord #discord-api #twilight

twilight-model

Discord API models for the Twilight ecosystem

48 releases (7 breaking)

0.7.2 Nov 20, 2021
0.6.5 Oct 7, 2021
0.6.0 Jul 31, 2021
0.3.3 Mar 14, 2021
0.2.4 Nov 29, 2020

#118 in Web programming

Download history 367/week @ 2021-08-09 297/week @ 2021-08-16 240/week @ 2021-08-23 240/week @ 2021-08-30 166/week @ 2021-09-06 287/week @ 2021-09-13 257/week @ 2021-09-20 269/week @ 2021-09-27 348/week @ 2021-10-04 681/week @ 2021-10-11 352/week @ 2021-10-18 342/week @ 2021-10-25 491/week @ 2021-11-01 721/week @ 2021-11-08 671/week @ 2021-11-15 373/week @ 2021-11-22

1,643 downloads per month
Used in 15 crates (14 directly)

ISC license

1MB
26K 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.1–1.8MB
~39K SLoC

la