A simple Rust Discord bot for rendering the output of the Routinator validity HTTP API endpoint as a textual table:
For example given the command !validity AS16509 185.49.143.0/24
the bot prints:
Since v0.1.2 it also shows the AS name (powered by the RIPEstat Data API):
Note: The AS prefix in the AS argument is optional and case insensitive.
- A Discord account with the right to create an application and bot.
- Discord 'Manage Server' permission on the Discord server to which the bot should be invited.
- Rust 1.51.0 (might actually work with older versions but currently only tested with current Rust stable which is 1.51.0 at the time of writing)
- Routinator 0.9.0
$ cargo build --release --locked
$ export DISCORD_TOKEN=xxx
$ export ROUTINATOR_HOST=some.fqdn.com
$ ./target/release/rover
$ sudo apt install -y ./path/to/rover.deb
$ export EDITOR=$(which vi)
$ sudo systemctl edit rover
[Service]
Environment="DISCORD_TOKEN=<Enter Discord token here>"
Environment="ROUTINATOR_HOST=<Enter Routinator host here>"
:x
$ sudo systemctl enable --now rover
- Create a Discord application and add a bot. See the official help.
- Copy the bot token and use that as the
DISCORD_TOKEN
environment variable. - Run the Rust bot either with
cargo run
or as a systemd service (if using the Debian package). - Create an OAuth 2 URL with scope
bot
and visit the URL as a user with 'Manage Server' right. - The ROVer bot should show up as joining the Discord server.
- Send the bot a message, e.g. with
!help
.
Thanks to pixabay for the ROVer image. Pixabay states for this image that is licensed under the Pixabay License which is "Free for commercial use" with "no attribution required". If you think this image is actually yours and not free to use please let us know!