No description
Find a file
2026-06-04 17:13:56 +01:00
.gitignore Initial quotebot: stdlib IRC quotes bot for Libera #r.trees 2026-06-04 17:13:56 +01:00
bot.py Initial quotebot: stdlib IRC quotes bot for Libera #r.trees 2026-06-04 17:13:56 +01:00
CLAUDE.md Initial quotebot: stdlib IRC quotes bot for Libera #r.trees 2026-06-04 17:13:56 +01:00
config.example.env Initial quotebot: stdlib IRC quotes bot for Libera #r.trees 2026-06-04 17:13:56 +01:00
memory.md Initial quotebot: stdlib IRC quotes bot for Libera #r.trees 2026-06-04 17:13:56 +01:00
README.md Initial quotebot: stdlib IRC quotes bot for Libera #r.trees 2026-06-04 17:13:56 +01:00

quotebot

A simple quotes IRC bot for Libera.Chat. Standard-library Python only — no pip install, no virtualenv. Connects over TLS, joins a channel, and serves quotes from a local SQLite database via ! commands.

Run it

python3 bot.py

That connects to irc.libera.chat:6697 as treesquotes and joins #r.trees.

To override anything, copy the example config and source it first:

cp config.example.env config.env     # config.env is gitignored
# edit config.env as needed
set -a; source config.env; set +a
python3 bot.py

Commands (in-channel)

Command Does
!quote Random quote
!quote <id> Quote by number
!addquote <text> Store a new quote, returns its id
!delquote <id> Delete a quote
!search <term> First quote containing a substring
!quotecount How many quotes are stored
!help List commands

Notes

  • Quotes live in quotes.db (SQLite, created on first run, gitignored).
  • The bot auto-reconnects with exponential backoff and answers PING.
  • If the nick is taken it appends _ and retries.
  • A NickServ password, if set via IRC_NICKSERV_PASS, is sent on connect — keep it in the environment, never in the repo.
  • Outbound messages are spaced by QUOTEBOT_SEND_DELAY seconds to avoid tripping Libera's flood limits.

Libera lets unregistered bots connect, but channels can be set to block unregistered users. To register treesquotes:

  1. Connect once, then /msg NickServ REGISTER <password> <email>.
  2. Confirm via the emailed code.
  3. Put the password in config.env as IRC_NICKSERV_PASS and restart.