Skip to content
Snippets Groups Projects

Invoke the bot callback in an async wrapper.

Merged Joseph Walton-Rivers requested to merge feature-better-async into main
1 file
+ 21
20
Compare changes
  • Side-by-side
  • Inline
+ 21
20
@@ -3,27 +3,36 @@
*note:* This is currently a (functional) work in progress.
## Features
* Get message from matrix (rooms, private messages)
* Send messages to matrix (responses) - with markdown support
* Single (1:1) rooms with the bot, which it considers private
* Group/named rooms
* Room spesific full-names
* Room aliases (#thing:example.com) are recognised and resolve correctly
* Sending of reactions to events
* Listening for reactions ([see the our errbot-matrix plugin](https://git.fossgalaxy.com/irc/errbot/errbot-matrix/-/blob/main/matrix.py))
* Notices, emotes, images - although the syntax requires a tidy up
* Exposing of matrix state (power levels, presence)
* Messages feature matrix spesific metadata in `extras` (event ids, times, etc...)
* Token-based auth, just like most native matrix bots :)
* Name detection based on token
### Still todo
Most (all) of these are in the library, just need mapping
* General code tidy up
* Some missing features for backend API (room methods, user methods)
* Support for e2e encryption (the matrix library natively supports it)
* Support for non-text message types (ie, images)
* Support for reactions
* Support for non-text message types (ie, images - limited support in place)
* Support for reactions (adding implemented, removing not implemented)
# Known issues
## Strange setup
The bot will exit if you use password authentication (after displaying the token and device id) - you then
need to manually stick these in the config file. Would be better if the bot could cache this in some errbot-y
way.
* Plugins that use images are unlikey to work - this is due to how matrix deals with images.
* !room join doesn't work, invite the bot to a room via matrix's invite process
* Although implemented, matrix chat effects don't seem to work.
* The bot defaults to 'text' rather than the more correct 'notice' for outgoing messages - it might not play nice with other bots.
If the bot doesn't do this, the bot generates a new device on each connection, which quickly becomes madness
on the server-side (100s of devices when developing). By fixing the device ID and token, this doesn't happen.
# Setup Steps
The bot requires an exisitng account and access token. Once you have these setting up the bot is relatively
simple.
The configuration file for errbot looks like this:
@@ -33,14 +42,6 @@ bot_extra_backend_dir = r'./backends/' # path to backends folder
BOT_IDENTITY = {
'homeserver': 'https://matrix.fgmx.uk',
'username': '@errbot:fossgalaxy.com',
# set these to get the token and device id
'password': '', # not used if token is set
'device': '', # not used if token is set
# once known...
#'device_id': '', # DEVICE ID HERE
#'token': '' # ACCESS TOKEN HERE
}
```
Loading