Giter Site home page Giter Site logo

rori_discord_bot_old's Introduction

Disclaimer: This is a draft version

rori_discord_bot

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.

Installation

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.

Configuration

Create a Discord Bot

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",

Connect to rori_server

Note: you need to configure a rori_server first.

Entry point side

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.

rori_server side

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"
  }
]

Authorize rori_server

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"
  }
]

Tls configuration

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.

Final

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"
   }
 ]
}

Execution

A binary is present in the target/ directory after a cargo build or you can execute cargo run in your shell.

License

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.

Contribute

Please, feel free to contribute to this project in submitting patches, corrections, opening issues, etc.

rori_discord_bot_old's People

Contributors

amarok1412 avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.