Skip to main content

Universal bot library with functions needed for basic Discord/Telegram bot development.

Project description

LibBotUniversal

PyPI - License Gitea Release PyPI - Python Version Code style: black

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
  • 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.

# 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

from libbot.pyrogram import PyroClient

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

    try:
        client.run()
    except KeyboardInterrupt:
        print("Shutting down...")
    finally:
        if client.scheduler is not None:
            client.scheduler.shutdown()
        exit()


if __name__ == "__main__":
    main()

Pycord

from discord import Intents
from libbot import sync
from libbot.pycord import PycordBot


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

    bot.load_extension("cogs")

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


if __name__ == "__main__":
    loop = 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.

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

libbot-4.0.0.tar.gz (28.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libbot-4.0.0-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

Details for the file libbot-4.0.0.tar.gz.

File metadata

  • Download URL: libbot-4.0.0.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for libbot-4.0.0.tar.gz
Algorithm Hash digest
SHA256 88733488f6ca01f71c1a533598c78a22ebb433fc52885041478c7ab6985f6eed
MD5 df2c991e565c8ac73bfd19f669e54095
BLAKE2b-256 1b2226008608d3cd76f7da727472515e43855e54dec3674f383ad379032928b0

See more details on using hashes here.

File details

Details for the file libbot-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: libbot-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 29.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for libbot-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 83f11c3e0486765c1a7acb82c5cfad521f9ad15911dddc368dd2fa6e29174e49
MD5 cba627928de2122476318294cd747d39
BLAKE2b-256 0b7efccc12392097c68f2f3dd43bd4abf7e57fa8f2455995931cb4ec44784150

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page