Welcome to The Terminal cafe Support Bot Repository
Hello, hope you are having a nice day. This is the official repository for The Terminal Cafe Support bot. It was created the to manage the support questions in an automated and organized way.
Technologies used
While creating this bot we tried to use efficient and modern technologies . We based the main logic on Rust and the main database is handled by PostgreSQL.
The rust libraries in use are listed here:
serenity-rs
: The main discord bot library.sqlx
: A library for accessing the sql database.tokio
: A fast asynchronous runtime.serde
: Data serialization and deserialization for the config file.serde_yaml
: Serde implementation for YAML.clap
: Launch argument parsing.regex
: Regex for input sanitazion.chrono
: Timestamps for the database.dotenv
:.env
file reading for easier environment variables during compile time.
Running
The bot requires a postgresql database with a table based on the schema in sql/ttc-bot.sql
to function, as well as a YAML config file with the following format:
---
token: <The bot token you wish to use>
sqlx_config: <A string for sqlx to connect to the database, postgres://username:password@host:port/database_name>
support_channel: <Discord channel id for the support channel>
owners: <Array of owner user ids, [<user_id>, <user_id>...]>
You need to set the DATABASE_URL
variable in .env
to the same value as sqlx_config
in the config file to allow for compile time checking of database calls. Running is done with cargo run -- -c <path/to/config/file>
.
Dependencies
If you want to install TTC support bot in your own system these following dependencies are required
- Latest rust toolchain is preferable
- PostgreSQL database
Contribute
If you want to contribute to our project feel free to do it
Naming conversion
If you work on the project please follow the naming conversion to minimize confusion. Use self explanatory class and function names, also try to comment out your code.
Example:
// This line prints the inc_id read from the DB
println!("{}", inc_id);
Please don't add anything offensive or political into the code base don't make it uncomfortable for others.
Credits
If you like our project and want to make a fork of it please add credits to the main repository.
Data collection
This bot only stores the following data when you create a support ticket.
userID - to manage the incident creator
timestamp - to find out when the incident is created
threadID - to store the conversertation thread for future referances
questions - to store the question for better searching ability
Contributors
Thanks to these people we are able to develop this project
Kiro | Lead Rust dev |
Ereshkigal | SQL and logic |
Thanks for using out software. See you in the discord server.