Skip to main content

mxbt

Yet another Matrix bot library, built on matrix-nio.

Feauters

  • Simple and powerfull bots creating
  • Custom emojis support
    • Getting
    • Sending
    • Creating
  • Files sending (external & internal)
  • Native mentions
  • Access to matrix-nio features
  • Event filters
  • Bot modules support
  • Wait for event system
  • E2EE support (check docs before)

Installation

With pip:

$ pip install mxbt

With git and python:

$ git clone https://codeberg.org/librehub/mxbt
$ cd mxbt
$ python -m pip install . 

Getting started

More examples here or in docs.

from mxbt import Bot, Context, Creds, Config, Filter, Listener
import asyncio

bot = Bot(
    creds=Creds.from_env(               # You also can use Creds.from_json and just Creds() 
        homeserver="MATRIX_HOMESERVER",
        username="MATRIX_USERNAME",
        password="MATRIX_PASSWORD"
    ),                               
    config=Config()                     # Config has many options for bot, like prefix, selfbot, encryption, etc...
)
lr = Listener(bot)

@lr.on_command(prefix="?", aliases=["test", "t"])
async def ctx_echo(ctx: Context) -> None:       # Context object contains main info about event
    await ctx.reply(ctx.body)                   # Reply message to event room

if __name__ == "__main__":
    asyncio.run(lr.start_polling())

.env structure

MATRIX_HOMESERVER=https://matrix.org/
MATRIX_USERNAME=user
MATRIX_PASSWORD=password

Built with mxbt

Project Description Project Description
sofie A simple selfbot charon Simple bridge between some messengers
cryptomx A crytpocurrency notification bot taskmx Simple project tasks bot

Special thanks

  • matrix.org for beautiful protocol.
  • 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-2024 Isaac Beverly
  • matrix-nio for cool client library.

Support

Any contacts and crytpocurrency wallets you can find on my profile page.

Release files for mxbt 0.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mxbt 0.3.7
File Size Uploaded
mxbt-0.3.7.tar.gz 34.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mxbt 0.3.7
File Interpreter ABI Platform
mxbt-0.3.7-py3-none-any.whl Python 3 none any Details

Total release size: 71.2 kB

Release files / mxbt-0.3.7.tar.gz

Download URL mxbt-0.3.7.tar.gz
Size 34.0 kB
Tags Source
SHA-256 checksum
How to use checksums
198574b2bad33c961e909f1b9d7c90a67990efde31299456dd86265a710bb63b
BLAKE2b-256 checksum
How to use checksums
ae2396fac6771b48cf4a26b96d020fd05fd8c71a1859b5f13d7c9a9b6361972b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.3

Release files / mxbt-0.3.7-py3-none-any.whl

Download URL mxbt-0.3.7-py3-none-any.whl
Size 37.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ebe517aac0ad313b9e00448f8738f6a91000709a676cfc701ebf58ded54965bd
BLAKE2b-256 checksum
How to use checksums
b0bbcbf6658c64b95e85d7471bff9c72627f9d6d2d4c80487a38ad717468dd76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.3
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page