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.6.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.6.0-py3-none-any.whl (35.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: libbot-4.6.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.12

File hashes

Hashes for libbot-4.6.0.tar.gz
Algorithm Hash digest
SHA256 253754a3246f1518fa21d5555df4f95504376ea1cfcbcfac0be5843e1b094595
MD5 edb0743d030892798444797d4c68b57b
BLAKE2b-256 09bb3e742caa76fac8940912acb616de4a7a8f7742517885b4091470a2c6c19a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libbot-4.6.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.12

File hashes

Hashes for libbot-4.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f1c778e197ea59052d8ce2092355754a8d7286114bf36032b19cbf8814e7db5
MD5 b286f33fbdb5f9977c3baf708e94a3c1
BLAKE2b-256 5a7144d7cc45d8f0da9f0ee4b7df8592bf8357e604281312ffeb3972f7317ee2

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