HOW IT WORKS
Basically, in simple terms.
You start the bot
- First, security is checked (firewall)
- Database connects (RocksDB)
- Web server starts — so you can log in through the browser
- Waits for you to authorize
- Connects to Matrix
- Crypto connects (OlmMachine)
- Modules load: first built-in, then yours from repositories
- Starts listening for new messages
When you type a command
Say you type .ping:
- Matrix sends a "new message" event
- The bot catches this event
- Decrypts if needed (if the room is encrypted)
- Sees it starts with
. - Looks for the matching command
- Checks permissions (are you OWNER? SUDO? or just someone?)
- If all good — executes the command
- Replies via
utils.answer()
Modules
There are two types:
- Core — built-in, ship with the bot. You can't change them, they're "frozen".
- Community — ones you install from repositories. Run in a sandbox, can't do harm.
If something's not clear
Check out Key Concepts — everything explained in simple terms.
If you're a developer and want to write modules, head over to Writing Modules.