Yet another Matrix bot library.
Project description
mxbt
Yet another Matrix bot library.
Installation
$ pip install mxbt
Getting started
More examples here. Or in docs.
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.3.2.tar.gz
(27.8 kB
view details)
Built Distribution
mxbt-0.3.2-py3-none-any.whl
(30.5 kB
view details)
File details
Details for the file mxbt-0.3.2.tar.gz
.
File metadata
- Download URL: mxbt-0.3.2.tar.gz
- Upload date:
- Size: 27.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8363ef5ce5161b02ca5040cf6c8836a09043598f63fdac4d57d725bc4ee9b6a |
|
MD5 | 6ed863d54cb6dac1682b09ad5eeea4e2 |
|
BLAKE2b-256 | 470911e92f5ca3c6b2408978d56366b04e4cafdf1aacd70f88d2e65b961bff1f |
File details
Details for the file mxbt-0.3.2-py3-none-any.whl
.
File metadata
- Download URL: mxbt-0.3.2-py3-none-any.whl
- Upload date:
- Size: 30.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24dd126f86bf7501095fb3722450e0200f9322eed40bb4df14080489acc688b7 |
|
MD5 | 1d0fe14967fa9c22e365ad7e591d971f |
|
BLAKE2b-256 | 80a41af77c2d90aa193f69b1f83437fe2c7adea50b9a22b4e1609f5b0c73c7da |