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
  • docs - Zensical and all related dependencies

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.6.2.tar.gz (33.9 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.6.2-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for libbot-4.6.2.tar.gz
Algorithm Hash digest
SHA256 faf5e62478a4fe51779088d0b450c5e5f2d13174061d20794f00630fccabaa07
MD5 b6d2f20c920a9285f9a5d70e7086ca1c
BLAKE2b-256 1765fbc3ebca957d0de45ef640265b71c451b7866c9c2f07c0b733298578df4e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for libbot-4.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c47c60317ccb66af9b15004eb355aff3a403f1b30faae11804a1c10cd34e3913
MD5 be421eb5dea73fa0dc7644ef5d4adabf
BLAKE2b-256 0b86fd7fda69d64f415cdcaa390765bf96401134494676256bed6d622935c3a5

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