Disclaimer: This is a draft version
RORI Discord Bot is an entry and an endpoint for RORI. This application is designed for a bot user on Discord based on this library to interact with RORI.
This application requires Rust (please read this page), openssl and libsodium. To build the software, you just have to launch cargo build
in this repository.
Please read this page to create a bot on Discord. When you have successfully created a bot on Discord, you can open config_endpoint.json and write:
"botname": "THE NAME OF YOUR BOT",
"channel": "THE CHANNEL ID ON DISCORD",
"token":"THE TOKEN OF YOUR BOT",
Note: you need to configure a rori_server
first.
TODO: I need to remove this file.
You can configure the connection from config_server.json:
{
"ip":"IP of rori_server",
"port":"port"
}
Moreover, you need to choose a secret (for the authentification) and a name for this entry point and write it in config_endpoint.json.
You need to authorize the entrypoint to communicate with rori_server
. In config_server.json you need to add:
"authorize": [
{
"name":"the name you choose",
"secret":"sha256 of the secret you choose"
}
]
You need to authorize rori_server
to communicate with you. In config_server.json you must add:
"authorize": [
{
"name":"the name of the rori_server",
"secret":"sha256 of the secret of the rori_server"
}
]
All connections need to be secured. So you need to generate a private key and a certificate. On linux, you can run this following command: openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem
. It will create a certificate (cert.pem) and a private key (key.pem). Now, you can add these files to config_endpoint.json.
The final config_endpoint.json should look like this:
{
"ip":"0.0.0.0",
"port":"1416",
"rori_ip":"127.0.0.1",
"rori_port":"1412",
"owner":"*",
"name":"rori_discord_bot",
"compatible_types":"text",
"cert":"key/cert.pem",
"key":"key/key.pem",
"secret": "secret",
"botname": "THE NAME OF YOUR BOT",
"channel": "THE CHANNEL ID ON DISCORD",
"token":"THE TOKEN OF YOUR BOT",
"authorize": [
{
"name":"rori_server",
"secret":"2BB80D537B1DA3E38BD30361AA855686BDE0EACD7162FEF6A25FE97BF527A25B"
}
]
}
A binary is present in the target/ directory after a cargo build
or you can execute cargo run
in your shell.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2016 Sébastien (AmarOk) Blin <https://enconn.fr>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0\. You just DO WHAT THE FUCK YOU WANT TO.
Please, feel free to contribute to this project in submitting patches, corrections, opening issues, etc.