Skip to main content

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


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.1.tar.gz (27.7 kB view details)

Uploaded Source

Built Distribution

mxbt-0.3.1-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

Details for the file mxbt-0.3.1.tar.gz.

File metadata

  • Download URL: mxbt-0.3.1.tar.gz
  • Upload date:
  • Size: 27.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for mxbt-0.3.1.tar.gz
Algorithm Hash digest
SHA256 8e695b8e0c38fbd638eb7344fb830aea602a6ae514afe0784f188d2130aa2d42
MD5 2edf720ab56e67ad5177d733ee0a62b1
BLAKE2b-256 df33965bf9085be1d739f1eb26f5428705935f7b4c491e8c46bc576d4cbf8b1a

See more details on using hashes here.

File details

Details for the file mxbt-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: mxbt-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 30.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for mxbt-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e790ff9b66bb9e585da4bfbdf23804e72cc7251c5ab16b085bc519a7ec204df
MD5 fd296ffbcef1e36225791b2fb7b5e7c4
BLAKE2b-256 4850d94a397db49356547eb3fd72cad32ad2f3708e1e4ebf2d6ee88888c8a473

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page