Crates.io | notbot |
lib.rs | notbot |
version | 0.6.13 |
source | src |
created_at | 2025-05-06 10:57:19.092176+00 |
updated_at | 2025-05-22 16:46:55.835967+00 |
description | Matrix chatbot, primarily used around the Warsaw Hackerspace channels and spaces |
homepage | https://code.hackerspace.pl/ar/notbot |
repository | https://codeberg.org/arachnist/notbot |
max_upload_size | |
id | 1662239 |
size | 444,978 |
notbot, a chatbot that started life in Go, and handling IRC protocol, embraced the riir meme, and is now running on Matrix.
The current iteration of this chatbot started after 38c3, when I've decided to actually try and learn rust. My go-to project for learning a programming language was always writing a chatbot with little to no regard for feature creep. This iteration exceeds at feature creep and undefined scope.
Bot modules, either commands reacting to specific keywords, or catch-all, can be implemented either natively in Rust (see: [crate::module
] for the documentation
of module system and a step-by-step guide on what to do), or Lua, thanks to being baited to try and run modules/plugins from
mun irc bot. The result of that was notmun, a slightly modified version of mun, with
some components removed that are no longer needed, that is embedded using the [mlua
] crate.
Many currently implemented features/modules are tailored for use at the Warsaw Hackerspace. As such, in the present state it might be difficult to get it running in a usable state elsewhere.
All modules can be restarted, and configuration can be reloaded without restaring the bot; mun modules - thanks to being written in lua and loaded at runtime from disk - can have their implementation completely changed at runtime.
Despite using [matrix_sdk
], additional modules are (for the most part) not implemented as native event handlers. Instead, each module is - essentially - its
own spawned tokio task waiting for messages on the receiving end of a [tokio::sync::mpsc
] channel.
This was done for several reasons:
../mun
notbot.example.toml
. Some parameters are required, and the bot will complain if they're missing, or if syntax is wrong.LUA_PATH='../mun/?;../mun/?.lua'
environment variable properly.RUST_LOG=notbot=info cargo run ./notbot.toml
Accepting PRs at hswaw forgejo, codeberg, patches hurled my way over Matrix or Fedi (bait your instance admin to change post length limit to 20000 😸), or whatever else we figure out and works.
Mind you, this is - still - a very "works on my devices" project. But if you get stuck somewhere, ping me and I can try helping out.
In no particular order:
notbottime.rs
LUA_PATH
env var for mlua