# 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 (external & internal)
- [x] Native mentions
- [x] Access to `matrix-nio` features
- [x] Event filters
- [x] Bot modules support
- [ ] Wait for event system
- [x] E2EE support (check [docs](docs/encryption.md) before)
## 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, 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
```env
MATRIX_HOMESERVER=https://matrix.org/
MATRIX_USERNAME=user
MATRIX_PASSWORD=password
```
## Built with mxbt
| Project | Description | Project | Description |
| :--- | :--- | :--- | :--- |
| [sofie](https://codeberg.org/librehub/sofie) | A simple selfbot | [charon](https://codeberg.org/librehub/charon) | Simple bridge between some messengers |
| [cryptomx](https://codeberg.org/librehub/cryptomx) | A crytpocurrency notification bot | [taskmx](https://codeberg.org/librehub/taskmx) | Simple project tasks bot |
## Special thanks
* [matrix.org](https://matrix.org) for beautiful protocol.
* [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-2024 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/ae/23/96fac6771b48cf4a26b96d020fd05fd8c71a1859b5f13d7c9a9b6361972b/mxbt-0.3.7.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 (external & internal)\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- [x] E2EE support (check [docs](docs/encryption.md) before)\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, Config, Filter, Listener\nimport asyncio\n\nbot = Bot(\n creds=Creds.from_env( # You also can use Creds.from_json and just Creds() \n homeserver=\"MATRIX_HOMESERVER\",\n username=\"MATRIX_USERNAME\",\n password=\"MATRIX_PASSWORD\"\n ), \n config=Config() # Config has many options for bot, like prefix, selfbot, encryption, etc...\n)\nlr = Listener(bot)\n\n@lr.on_command(prefix=\"?\", aliases=[\"test\", \"t\"])\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**.env** structure\n```env\nMATRIX_HOMESERVER=https://matrix.org/\nMATRIX_USERNAME=user\nMATRIX_PASSWORD=password\n```\n\n## Built with mxbt\n\n| Project | Description | Project | Description |\n| :--- | :--- | :--- | :--- |\n| [sofie](https://codeberg.org/librehub/sofie) | A simple selfbot | [charon](https://codeberg.org/librehub/charon) | Simple bridge between some messengers |\n| [cryptomx](https://codeberg.org/librehub/cryptomx) | A crytpocurrency notification bot | [taskmx](https://codeberg.org/librehub/taskmx) | Simple project tasks bot |\n\n## Special thanks\n\n* [matrix.org](https://matrix.org) for beautiful protocol.\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-2024 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.7",
"project_urls": {
"Homepage": "https://codeberg.org/librehub/mxbt"
},
"split_keywords": [
"python",
" matrix-nio",
" matrix",
" bot",
" api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b0bbcbf6658c64b95e85d7471bff9c72627f9d6d2d4c80487a38ad717468dd76",
"md5": "63aa7797d1c624f35043288819d9eac7",
"sha256": "ebe517aac0ad313b9e00448f8738f6a91000709a676cfc701ebf58ded54965bd"
},
"downloads": -1,
"filename": "mxbt-0.3.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "63aa7797d1c624f35043288819d9eac7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 37236,
"upload_time": "2024-06-09T08:41:40",
"upload_time_iso_8601": "2024-06-09T08:41:40.396957Z",
"url": "https://files.pythonhosted.org/packages/b0/bb/cbf6658c64b95e85d7471bff9c72627f9d6d2d4c80487a38ad717468dd76/mxbt-0.3.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ae2396fac6771b48cf4a26b96d020fd05fd8c71a1859b5f13d7c9a9b6361972b",
"md5": "c7e2991a7e41920ae4170a78d903d869",
"sha256": "198574b2bad33c961e909f1b9d7c90a67990efde31299456dd86265a710bb63b"
},
"downloads": -1,
"filename": "mxbt-0.3.7.tar.gz",
"has_sig": false,
"md5_digest": "c7e2991a7e41920ae4170a78d903d869",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 34003,
"upload_time": "2024-06-09T08:41:42",
"upload_time_iso_8601": "2024-06-09T08:41:42.385238Z",
"url": "https://files.pythonhosted.org/packages/ae/23/96fac6771b48cf4a26b96d020fd05fd8c71a1859b5f13d7c9a9b6361972b/mxbt-0.3.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-09 08:41:42",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": true,
"codeberg_user": "librehub",
"codeberg_project": "mxbt",
"lcname": "mxbt"
}