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

# 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

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

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.

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.5.0.tar.gz (31.7 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.5.0-py3-none-any.whl (35.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: libbot-4.5.0.tar.gz
  • Upload date:
  • Size: 31.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for libbot-4.5.0.tar.gz
Algorithm Hash digest
SHA256 951225bc953fe48068f1e33592f24374648b86655af6d908534a1fcd74452a9e
MD5 00748eb827e7fbe5fb9de7fc886b2da5
BLAKE2b-256 8ef759c07b856b7aa0c1f8b59fb9636f46fca4436485e1663b2613ae67d44de2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libbot-4.5.0-py3-none-any.whl
  • Upload date:
  • Size: 35.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for libbot-4.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da7f7d20bd7ebe0dfbe5805bf8f04b5521507a71b540048e7b38a2771dd0dffd
MD5 5fbbb3e59a1eba56169189f51897979d
BLAKE2b-256 a15b070a6759b494d15c3d97b3a1b407f1f75e5e37409b595e1f3e0c4eba6efe

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