Yet another Matrix bot library.
Project description
mxbt
Yet another Matrix bot library.
Installation
$ pip install mxbt
Getting started
More examples here.
from mxbt import Bot, Context, Creds, Filter
bot = Bot(
prefix="!", # Standart command prefix, commands can setup it own prefix
creds=Creds.from_json_file("credits.json")
)
@bot.on_command(prefix="?", aliases=["test", "t"])
@Filter.from_users(['@username:homeserver']) # Event works only with this senders
async def ctx_echo(ctx: Context) -> None: # Context object contains main info about event
await ctx.reply(ctx.body) # Reply message to event room
bot.run()
credits.json structure
{
"homeserver" : "https://matrix.org",
"user_id" : "user",
"password" : "password"
}
Special thanks
- simplematrixbotlib for base parts of API, Listener and Callbacks code ideas. Code from simplematrixbotlib is included under the terms of the MIT license - Copyright (c) 2021-2023 Isaac Beverly
- matrix-nio for cool client library.
Contacts
Contact | Description |
---|---|
Matrix |
Matrix server |
Donates
Monero/XMR: 47KkgEb3agJJjSpeW1LpVi1M8fsCfREhnBCb1yib5KQgCxwb6j47XBQAamueByrLUceRinJqveZ82UCbrGqrsY9oNuZ97xN
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mxbt-0.2.2.tar.gz
(25.3 kB
view details)
Built Distribution
mxbt-0.2.2-py3-none-any.whl
(27.7 kB
view details)
File details
Details for the file mxbt-0.2.2.tar.gz
.
File metadata
- Download URL: mxbt-0.2.2.tar.gz
- Upload date:
- Size: 25.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37e80be115cfadbb0def4d647bc20c315a01eeb6aa359dc3ca0462b13dc50a36 |
|
MD5 | 364a7e7db44ac878cfcce2edcb74da3d |
|
BLAKE2b-256 | aa40ae6352da2e5ee5ff101af1b579dee4d9974596556c17ec0316482725f0f2 |
File details
Details for the file mxbt-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: mxbt-0.2.2-py3-none-any.whl
- Upload date:
- Size: 27.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b09405131b50d31ba242c6b39f861203a5d1cfff65f8345822576b2df8a4713e |
|
MD5 | c63e6eb7011e795834d380d4f13ba107 |
|
BLAKE2b-256 | ad3f972aee6d055fe32347de6d81f1fd1b8f8fa442fdf7948d1f7be053afcb68 |