Automate
Automate is a low level and asynchronous rust library for interacting with the Discord API
Getting started
Automate currently only works with Rust nightly. The tested version and the one used in CI is
nightly-2020-01-31
. Refer to rust edition guide
to learn how to switch to rust nightly.
In order to use Automate in your project, add the following line to your Cargo.toml
:
[dependencies]
automate = "0.2.1"
You can then write the following in your main.rs
. This simple example will respond Hello ! to any
user posting a message in any channel while ignoring messages from bots.
In order for this example to work, you need to define the DISCORD_API_TOKEN
environment variable. You can create a
bot and generate a token on Discord's developers portal.
extern crate automate;
use ;
use MessageCreateDispatch;
use CreateMessage;
use env;
async
For examples with more details, see in the examples
folder.
Contributing
Any kind of contribution is welcome, from issues to pull requests. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.
License
Licensed under the MIT license.