Skip to content

benrucker/JermaBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

599 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JermaBot

GPLv3 License

JermaBot is a Discord bot inspired by Jerma985. It is a 24/7 general-purpose bot with an emphasis on adding sound functionality to your server.

Feature Highlights

  • Text-To-Speech - For those who cannot talk in voice, JermaBot offers TTS. Just use the speak command.
  • Sound File Management - Add a sound file to JermaBot using addsound and you can play it back in a voice channel at any time with play.
  • Join Sounds - A grand entrance is a good entrance, so if a sound's name matches your username, JermaBot will play it automatically when you join a voice channel.
  • Fun - A plethora of random commands are at your disposal, such as downsmash, jermalofi, and drake.

Setup

You can add this bot to your server or install it locally.

Adding JermaBot to your server (recommended)

Click here to invite JermaBot to your server!

Inviting Jerma to your server is the easiest way to get to use him! I recommend this over installing him locally.

Note: some commands you might see in the code are guild-specfic. Send $help to see what commands you can call.

Installing JermaBot locally

Setup:

  1. Install FFMPEG
    • ffmpeg needs to be on your system path.
  2. Set up TTS (Required only for speak)
    • If you want to use speak, you will need voice.exe if you're on Windows, or libespeak1 if you're on Linux.
    • The official JermaBot instance uses Mycroft Mimic as the TTS engine.
      1. Follow the mimic build directions
        • (You will need to run ./configure CFLAGS="-g -O2 -Wno-error=discarded-qualifiers")
      2. Substitute https://sourceforge.net/projects/pcre/files/pcre2/10.23/pcre2-10.23.zip for the ftp link in mimic1/dependency.sh
      3. Add the path to mimic to the launch flags
  3. Set up Japanese TTS (Required only for speakanime)
    1. Install espeak from here, if you're on Windows, or run sudo apt install espeak on Linux.
    2. Make sure that espeak is on your system path.
    3. Install open_jtalk with sudo apt install open-jtalk.
    4. Download the voice "Mei" from here.
    5. Put the "Mei" voice files somewhere safe, you will need to add that path to JermaBot's startup parameters.
  4. Clone the repo by pasting this in the command line:
git clone https://github.com/benrucker/JermaBot.git
  1. cd into the repo with this command:
cd JermaBot
  1. Install uv, then install the needed Python packages by pasting this in the command line:
uv sync
  1. Create a file called .env in the folder jerma/ holding your bot's token:
DISCORD_TOKEN=...

The bot loads .env on startup, so no environment configuration is needed in your shell profile or systemd unit. Variables already present in the process environment take precedence over the file.

(Optional) Coding agent setup

JermaBot includes a minimal agent harness because it seems fun! These instructions set that up, but are not required for the rest of the bot to function.

  1. Install the Claude Code CLI
  2. Install the GitHub CLI (gh)
  3. Add the agent's credentials to jerma/.env:
# From `claude setup-token` (skippable on a dev machine already logged in to `claude`)
CLAUDE_CODE_OAUTH_TOKEN=...
# A fine-grained personal access token for the target repos, with
# read/write on Contents and Pull requests:
# https://github.com/settings/personal-access-tokens/new
GITHUB_TOKEN=...

Running JermaBot:

Run the bot through the command line like this:

cd jerma
uv run main.py [ (-mycroft MYCROFT_PATH | -voice VOICE_PATH | -espeak),
                 (-mv MYCROFT_VOICE)]
               [-jd JTALK_PATH]
               [-jv JAPANESE_VOICE]
  • -mycroft, -voice, -espeak: You must include one of these flags on startup to specify which tts engine Jerma will use. If you do mycroft or voice, you must also include the path to the mimic.exe or voice.exe after the flag.
    • e.g. -mycroft tts/mimic.exe
  • -mv PATH_TO_VOICE allows you to specify which voice you want to use with mycroft mimic. This flag is optional.

Usage

Once JermaBot has joined your server, send $help to see a list of commands. Do $help <command> to see more details about a certain command (e.g. $help speak).

About

A wacky, sound-oriented Discord bot

Topics

Resources

License

Code of conduct

Stars

6 stars

Watchers

2 watching

Forks

Contributors