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

Uploaded Python 3

File details

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

File metadata

  • Download URL: libbot-4.6.1.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.1.tar.gz
Algorithm Hash digest
SHA256 86529c4e16840050e2a4dce9711b8f5ff6e7e7ea2fe725fb6169643e88d204a7
MD5 5d43a0fbd251ae57ac1026659e8d1604
BLAKE2b-256 9ca7cee60bb88573971c622b000ce2fd0b6de9bbc17eaf8dcf4cc63fc4bd99c2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libbot-4.6.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fdbdaa1fb4d3a0b47e6c37c305dce276802854f926ce22877e096ec213e4d95e
MD5 e5ec8a95aa4bd453fa216737ca6eb0a3
BLAKE2b-256 ab49f1b13e232718e176b593c8b8f4733cf273716110f5d313511673d33c0041

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