mxbt


Namemxbt JSON
Version 0.3.5 PyPI version JSON
download
home_pagehttps://codeberg.org/librehub/mxbt
SummaryYet another Matrix bot library.
upload_time2024-04-26 15:43:57
maintainerNone
docs_urlNone
authorloliconshik3
requires_pythonNone
licenseNone
keywords python matrix-nio matrix bot api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mxbt 

Yet another Matrix bot library, built on [matrix-nio](https://github.com/matrix-nio/matrix-nio).

## Feauters

- [x] Simple and powerfull bots creating
- [ ] Custom emojis support
    - [x] Getting
    - [x] Sending
    - [ ] Creating
- [x] Files sending
    - [x] External files
    - [x] Internal files
- [x] Native mentions
- [x] Access to `matrix-nio` features
- [x] Event filters
- [x] Bot modules support
- [ ] Wait for event system
- [ ] Full e2ee support

## Installation

**With pip:**

```sh
$ pip install mxbt
```

**With git and python:**

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

## Getting started

More examples [here](examples/) or in [docs](https://librehub.codeberg.page/mxbt/).

```python
from mxbt import Bot, Context, Creds, Filter, Listener
import asyncio

bot = Bot(
    prefix="!",          # Standart command prefix, commands can setup it own prefix
    creds=Creds.from_json_file("credits.json")
)
lr = Listener(bot)

@lr.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

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

**credits.json** structure
```json
{
    "homeserver" : "https://matrix.org",
    "user_id" : "user",
    "password" : "password"
}
```

## Built with mxbt

| Project                                               | Description                       |
| :---                                                  | :---                              |
| [sofie](https://codeberg.org/librehub/sofie)          | A simple selfbot                  |
| [cryptomx](https://codeberg.org/librehub/cryptomx)    | A crytpocurrency notification bot | 

## Special thanks

* [simplematrixbotlib](https://codeberg.org/imbev/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](https://github.com/poljar/matrix-nio) for cool client library.

## Support

Any contacts and crytpocurrency wallets you can find on my [profile page](https://warlock.codeberg.page).



            

Raw data

            {
    "_id": null,
    "home_page": "https://codeberg.org/librehub/mxbt",
    "name": "mxbt",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python, matrix-nio, matrix, bot, api",
    "author": "loliconshik3",
    "author_email": "loliconshik3@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/47/cf/f6f268d5d7d002d247c510bf59de2e4512216d03f95619695df62bda56f6/mxbt-0.3.5.tar.gz",
    "platform": null,
    "description": "# mxbt \n\nYet another Matrix bot library, built on [matrix-nio](https://github.com/matrix-nio/matrix-nio).\n\n## Feauters\n\n- [x] Simple and powerfull bots creating\n- [ ] Custom emojis support\n    - [x] Getting\n    - [x] Sending\n    - [ ] Creating\n- [x] Files sending\n    - [x] External files\n    - [x] Internal files\n- [x] Native mentions\n- [x] Access to `matrix-nio` features\n- [x] Event filters\n- [x] Bot modules support\n- [ ] Wait for event system\n- [ ] Full e2ee support\n\n## Installation\n\n**With pip:**\n\n```sh\n$ pip install mxbt\n```\n\n**With git and python:**\n\n```sh\n$ git clone https://codeberg.org/librehub/mxbt\n$ cd mxbt\n$ python -m pip install . \n```\n\n## Getting started\n\nMore examples [here](examples/) or in [docs](https://librehub.codeberg.page/mxbt/).\n\n```python\nfrom mxbt import Bot, Context, Creds, Filter, Listener\nimport asyncio\n\nbot = Bot(\n    prefix=\"!\",          # Standart command prefix, commands can setup it own prefix\n    creds=Creds.from_json_file(\"credits.json\")\n)\nlr = Listener(bot)\n\n@lr.on_command(prefix=\"?\", aliases=[\"test\", \"t\"])\n@Filter.from_users(['@username:homeserver'])    # Event works only with this senders\nasync def ctx_echo(ctx: Context) -> None:       # Context object contains main info about event\n    await ctx.reply(ctx.body)                   # Reply message to event room\n\nif __name__ == \"__main__\":\n    asyncio.run(lr.start_polling())\n```\n\n**credits.json** structure\n```json\n{\n    \"homeserver\" : \"https://matrix.org\",\n    \"user_id\" : \"user\",\n    \"password\" : \"password\"\n}\n```\n\n## Built with mxbt\n\n| Project                                               | Description                       |\n| :---                                                  | :---                              |\n| [sofie](https://codeberg.org/librehub/sofie)          | A simple selfbot                  |\n| [cryptomx](https://codeberg.org/librehub/cryptomx)    | A crytpocurrency notification bot | \n\n## Special thanks\n\n* [simplematrixbotlib](https://codeberg.org/imbev/simplematrixbotlib) for base parts of API, Listener and Callbacks code ideas. \nCode from simplematrixbotlib is included under the terms of the MIT license - Copyright (c) 2021-2023 Isaac Beverly\n* [matrix-nio](https://github.com/poljar/matrix-nio) for cool client library.\n\n## Support\n\nAny contacts and crytpocurrency wallets you can find on my [profile page](https://warlock.codeberg.page).\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Yet another Matrix bot library.",
    "version": "0.3.5",
    "project_urls": {
        "Homepage": "https://codeberg.org/librehub/mxbt"
    },
    "split_keywords": [
        "python",
        " matrix-nio",
        " matrix",
        " bot",
        " api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c5f67bf6765e27b66811e3cfc833f4167922906241b23e906fb83c704dd031f3",
                "md5": "dcd24800ac339105222edf41745b3971",
                "sha256": "851032565109060a67e45731a0fa61ebb2c1603ea414e35cf057db16ddc868ef"
            },
            "downloads": -1,
            "filename": "mxbt-0.3.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dcd24800ac339105222edf41745b3971",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 32314,
            "upload_time": "2024-04-26T15:43:54",
            "upload_time_iso_8601": "2024-04-26T15:43:54.854755Z",
            "url": "https://files.pythonhosted.org/packages/c5/f6/7bf6765e27b66811e3cfc833f4167922906241b23e906fb83c704dd031f3/mxbt-0.3.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "47cff6f268d5d7d002d247c510bf59de2e4512216d03f95619695df62bda56f6",
                "md5": "0e12b23196928ccab4af4ffde7580c78",
                "sha256": "acb194cc676d16316d3033ebfeb6b7eda5f8d0eec75ee81ca426bae7472b13d5"
            },
            "downloads": -1,
            "filename": "mxbt-0.3.5.tar.gz",
            "has_sig": false,
            "md5_digest": "0e12b23196928ccab4af4ffde7580c78",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 29987,
            "upload_time": "2024-04-26T15:43:57",
            "upload_time_iso_8601": "2024-04-26T15:43:57.270799Z",
            "url": "https://files.pythonhosted.org/packages/47/cf/f6f268d5d7d002d247c510bf59de2e4512216d03f95619695df62bda56f6/mxbt-0.3.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-26 15:43:57",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": true,
    "codeberg_user": "librehub",
    "codeberg_project": "mxbt",
    "lcname": "mxbt"
}
        
Elapsed time: 0.24183s