Skip to main content

Yet another Matrix bot library.

Project description

mxbt v0.2.3

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.2.5.tar.gz (26.0 kB view hashes)

Uploaded Source

Built Distribution

mxbt-0.2.5-py3-none-any.whl (28.7 kB view hashes)

Uploaded Python 3

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