A Discord bot written in Ruby, originally made for a private Discord community. The name comes from one of the main heroines of Fate/stay night, Tohsaka Rin.
Rails web interface for the bot here: TohsakaWeb.
Installation & Running
- Enable Privileged Gateway Intents here:
- Install Ruby (rbenv recommended for Linux) and MariaDB
- Use these SQL commands to create user and database for the bot. Remember to change USERNAMEs and PASSWORD.
CREATE USER 'USERNAME'@'localhost' IDENTIFIED BY 'PASSWORD'; CREATE DATABASE IF NOT EXISTS tohsaka CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; GRANT ALL PRIVILEGES on tohsaka.* to 'USERNAME'@'localhost'; FLUSH privileges;
- Switch to the root folder of the bot and run the following command to populate the database with tables:
mysql -u USERNAME -p tohsaka < structure.sql
- Install bundler:
gem install bundler
bundle installto install required gems.
- On Windows, if installing the mysql2 gem fails, install it separetely with:
gem install mysql2 -- '--with-mysql-lib="C:\devkit\MariaDB 10.5\lib" --with-mysql-include="C:\devkit\MariaDB 10.5\include"'
- Start the bot by running
bundle exec ruby run.rb.
- Bot can be invited to a server with the following URL (remember to change the CLIENT_ID):
Documentation with YARD
YARD files can be generated with:
They can be viewed by opening
doc/_index.html in a browser.
Testing with RSpec
Tests can be performed with
- Ruby >= 2.7 supported
- MariaDB / MySQL
- Gems specified in Gemfile (installed by
- Using discordrb @ master branch