The examples listed in each directory demonstrate different use cases of the library, and increasingly show more advanced or in-depth code.
All examples have documentation for new concepts, and try to explain any new concepts. Examples should be completed in order, so as not to miss any documentation.
To run an example, you have the option of either:
- cloning this repository,
cd
ing into the example's directory, and then runningcargo run
to run the example; or - copying the contents of the example into your local binary project
(created via
cargo new test-project --bin
) and ensuring that the contents of theCargo.toml
file contains that of the example's[dependencies]
section, and then executingcargo run
.
Note that all examples - by default - require an environment token of
DISCORD_TOKEN
to be set. If you don't like environment tokens, you can
hardcode your token in.
If you have any questions, feel free to submit an issue with what can be clarified.