#discord-bot #serenity #gnomes

app sir_bot

A simple tts discord bot interacting with NovelAI's tts api

1 stable release

1.2.0 Mar 23, 2024

#269 in Audio

Custom license

2MB
549 lines

SirBot

The Cheeky sir in question

GitHub Actions Workflow Status X (formerly Twitter) URL

Overview

A TTS bot for discord utilising NovelAI text to speech voices.

This is generally designed to only run on some personal private discord servers with a couple of friends Therefore there isn't a huge provision for sharding / dealing with multiple servers using it at once. Serenity does handle sharding etc. so upgrading to work across more servers is possible, and a future goal, if only for practicing coding.

A Note on TTS

NovelAI's TTS is a very open API, it doesn't require setting up an account and is surprisingly easy to utilise, I would suggest taking care when using it, you get 100 free generations and can get through them quite quickly. Beyond that it's good manners not to abuse public APIs that are useful and cool :)

A Note on RTVS

This bot is HEAVILY inspired by the blue gnome from HLVRAI:Alyx As far as I can tell Trog (one of the members) wrote a bot to do the exact same thing. That set of streams is why in particular it defaults to using "aHaleAndHeartySir" as the voice. Please go check them all out, they are cool and funny and generally a delight.

How to Use

Download a copy of the bot (I will make releases in the future)

> git clone https://github.com/Fritzbox2000/sir_bot.git

Set a discord bot ID token in the environment

DISCORD_TOKEN="..."  

This token is generated when you create the bot, you can only look at it once before you have to re-generate it so make sure to write it down somewhere

Edit prerecordedtable_example.toml with user ID's and audio clips and then rename it to: prerecordedtable.toml

Then build and run

cargo run

Logging is now available! personal preference means I run:

RUST_LOG="sir_bot=info" ./sir_bot 

logging levels are:

  1. error
  2. warn
  3. info
  4. debug
  5. trace

Removing sir_bot= will output logging for serentiy and a bunch of other crates I am using which might be useful but mainly only for dev-work.

TODO / Dev work

TODOs:

  • Lots of pictures of gnomes that cycle
  • An internal voice to fall back on since I can run out of generations / more voices
  • Editable join and leave messages
  • Play YouTube videos
  • Pause, Stop etc. controls
  • Play music from my library maybe?
  • trace level logging
  • test suite (more for github actions than anything else)

Dependencies

~20–33MB
~573K SLoC