Skip to main content

Yet another Matrix bot library.

Project description

mxbt v0.2.7

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

Uploaded Source

Built Distribution

mxbt-0.2.7-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mxbt-0.2.7.tar.gz
Algorithm Hash digest
SHA256 53c77d4e36fb904956f5a7aa0313415ab80d3c9289fa0700156bb365b39b8a1d
MD5 cd84bfc796f50913ed8bd93506f43fd6
BLAKE2b-256 847f2d7b99c8c0cb40395fea35e1dc30dcea29cdf0cf1828be38bfb0bfdf034c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mxbt-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 29.1 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.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 2d60608dd6016973c0a49f808d0a870505ad11de7ffd5d18e1f54da04407d166
MD5 98e9d98bab4546a322f2ff5163b5304a
BLAKE2b-256 70dc858a16d20a0a6c0d35e16cc11e0880b3ac9f37b2ca629904733b0b89a49a

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