Metadata-Version: 2.4
Name: libbot
Version: 4.5.0
Summary: Universal bot library with functions needed for basic Discord/Telegram bot development.
Author: Profitroll
License-Expression: GPL-3.0
Project-URL: Source, https://git.end-play.xyz/profitroll/LibBotUniversal
Project-URL: Documentation, https://git.end-play.xyz/profitroll/LibBotUniversal/wiki
Project-URL: Tracker, https://git.end-play.xyz/profitroll/LibBotUniversal/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiofiles<26.0.0,>=23.0.0
Requires-Dist: typing-extensions<5.0.0,>=4.0.0
Provides-Extra: dev
Requires-Dist: black<27.0.0,>=25.0.0; extra == "dev"
Requires-Dist: build~=1.4.0; extra == "dev"
Requires-Dist: isort<9.0.0,>=8.0.0; extra == "dev"
Requires-Dist: mypy<2.0.0,>=1.0.0; extra == "dev"
Requires-Dist: pylint<5.0.0,>=4.0.0; extra == "dev"
Requires-Dist: pytest-asyncio<2.0.0,>=1.0.0; extra == "dev"
Requires-Dist: pytest-cov<8.0.0,>=7.0.0; extra == "dev"
Requires-Dist: pytest<9.0.0,>=8.0.0; extra == "dev"
Requires-Dist: tox<5.0.0,>=4.0.0; extra == "dev"
Requires-Dist: tox-uv<2.0.0,>=1.0.0; extra == "dev"
Requires-Dist: twine<7.0.0,>=6.0.0; extra == "dev"
Requires-Dist: types-aiofiles<26.0.0,>=23.0.0; extra == "dev"
Requires-Dist: types-ujson<6.0.0,>=5.0.0; extra == "dev"
Provides-Extra: pycord
Requires-Dist: apscheduler<4.0.0,>=3.0.0; extra == "pycord"
Requires-Dist: py-cord~=2.7.0; extra == "pycord"
Provides-Extra: pyrogram
Requires-Dist: apscheduler<4.0.0,>=3.0.0; extra == "pyrogram"
Requires-Dist: pyrofork<2.4.0,>=2.3.0; extra == "pyrogram"
Provides-Extra: speed
Requires-Dist: ujson<6.0.0,>=5.0.0; extra == "speed"
Provides-Extra: cache
Requires-Dist: pymemcache<5.0.0,>=4.0.0; extra == "cache"
Requires-Dist: redis<8.0.0,>=7.0.0; extra == "cache"
Dynamic: license-file

<h1 align="center">LibBotUniversal</h1>

<p align="center">
<a href="https://git.end-play.xyz/profitroll/LibBotUniversal/src/branch/master/LICENSE"><img alt="PyPI - License" src="https://img.shields.io/pypi/l/libbot">
<a href="https://git.end-play.xyz/profitroll/LibBotUniversal/releases/latest"><img alt="Gitea Release" src="https://img.shields.io/gitea/v/release/profitroll/LibBotUniversal?gitea_url=https%3A%2F%2Fgit.end-play.xyz"></a>
<a href="https://pypi.org/project/libbot/"><img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/libbot"></a>
<a href="https://git.end-play.xyz/profitroll/LibBotUniversal"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
</p>  

Handy library for Telegram/Discord bots development.

## Getting started

There are different sub-packages available:

* pyrogram - Telegram bots with Pyrogram's fork "Pyrofork"
* pycord - Discord bots with Pycord
* speed - Performance improvements
* cache - Support for Redis and Memcached
* dev - Dependencies for package development purposes

You can freely choose any sub-package you want, as well as add multiple (comma-separated) or none at all.

```shell
# Only general features
pip install libbot

# Only with Pyrogram
pip install libbot[pyrogram]

# With Pycord and Performance improvements
pip install libbot[pycord,speed]
```

## Examples

### Pyrogram

```python
import sys

from libbot.pyrogram.classes import PyroClient


def main():
    client: PyroClient = PyroClient()

    try:
        client.run()
    except KeyboardInterrupt:
        print("Shutting down...")
    finally:
        sys.exit()


if __name__ == "__main__":
    main()
```

### Pycord

```python
import asyncio
from asyncio import AbstractEventLoop

from discord import Intents
from libbot.utils import config_get
from libbot.pycord.classes import PycordBot


async def main():
    intents: Intents = Intents.default()
    bot: PycordBot = PycordBot(intents=intents)

    bot.load_extension("cogs")

    try:
        await bot.start(config_get("bot_token", "bot"))
    except KeyboardInterrupt:
        print("Shutting down...")
        await bot.close()


if __name__ == "__main__":
    loop: AbstractEventLoop = asyncio.get_event_loop()
    loop.run_until_complete(main())
```

## Config examples

For bot config examples please check the examples directory. Without a valid config file, the bot won't start at all, so
you need to make sure the correct config file is used.
