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.3.tar.gz
(25.6 kB
view details)
Built Distribution
mxbt-0.2.3-py3-none-any.whl
(28.3 kB
view details)
File details
Details for the file mxbt-0.2.3.tar.gz
.
File metadata
- Download URL: mxbt-0.2.3.tar.gz
- Upload date:
- Size: 25.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0089808ee9dfd918620dc8c9cb2d4acf22a2d008856cf6686ecf0200f9138cf3 |
|
MD5 | a7fb70b326f1f121f0f19ad810a8a77f |
|
BLAKE2b-256 | 45f98960f80a94d32b793ac9ca987907fd698de5e63b583bd809a2245c433480 |
File details
Details for the file mxbt-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: mxbt-0.2.3-py3-none-any.whl
- Upload date:
- Size: 28.3 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 | 2bcc0fd7bfa703683225b6857e039e1ccd08f82d68679116e1f1b782b81d57da |
|
MD5 | 910247b72f6d75fd8f88714fd7f86402 |
|
BLAKE2b-256 | a1d28b8506491cdc8f32135dd75d8c94cc13d06bed4e74eb7cbd2877db2ec192 |