A lightweight, async Python 3 IRC bot with hot-reloadable plugins and persistent configuration.
- Hot-Reloading: Load, unload, and reload plugins without restarting the bot.
- Persistence: Plugin states (enabled/disabled) are saved automatically to
config.yaml. - Async Core: Built on
asynciofor efficient handling of IO and multiple connections. - Batteries Included: Comes with plugins for ChatGPT, Bitcoin prices, Reddit, Instagram, Weather (SMHI), and more.
-
Install dependencies:
python3 -m venv .venv && source .venv/bin/activate pip install -r requirements.txt
-
Configure:
cp config_sample.yaml config.yaml # Edit config.yaml with your IRC server details and API keys -
Run:
python bot.py
.plugins- List all loaded plugins..load <plugin>- Load a plugin (e.g.,.load chatgpt)..unload <plugin>- Unload a plugin..reload <plugin>- Reload a plugin to apply code changes immediately.
Admins defined in config.yaml can authenticate to perform sensitive actions:
- Message the bot:
.auth <password> - Use admin commands:
.join <channel>,.part <channel>,.say <channel> <message>.
Plugins are located in the scripts/ directory.
To create a new plugin:
- Create a file in
scripts/(e.g.,myplugin.py). - Implement
on_message(bot, user, channel, message). - (Optional) Implement
on_load(bot)andon_unload(bot).
See scripts/_template.py for a complete example.