Skip to main content

An intuitive framework for creating Telegram bots

Project description

Pyrubrum
An intuitive framework for creating Telegram bots.
Create your own bot in less than 100 lines!

Channel: @pyrubrum Developer: @hearot License: GPLv3

Pyrubrum

from pyrogram import Client
from pyrubrum import Handler, Menu, transform

bot = Client(...)

handler = Handler(transform(
    {
        Menu("Start", "start", "Hello!", default=True): [
            Menu("About me", "about_me", "I'm just a bot!"),
            Menu("Thoughts", "thoughts",
                 "I'm a bot, I cannot think properly..."),
        ]
    }
))

handler.setup(bot)
bot.run()

Pyrubrum (/ˈpaɪɹˈuːbɹəm/) is a versatile, charming framework for creating Telegram bots, jointly with Pyrogram.

Features

  • Automatic deep-link generation with DeepLinkMenu
  • Built-in support for Redis
  • Complete documentation
  • Custom styles for inline keyboards
  • Database integration
  • Fast & optimized using MTProto jointly with Pyrogram
  • Fully encrypted parameters
  • Intuitive creation of inline keyboards
  • LRU caching with functools.lru_cache
  • Native support for the "Go back" button
  • No limit for callback_data (see Telegram Bot API)
  • Paging integration with PageMenu

Examples

In order to make use of the proposed examples, you need to create your own environment file by renaming sample.env into .env and editing all the necessary variables.

  • Café - Get an overview of the design which lies inside Pyrubrum while interacting with multiple commands and pages.
  • Calendar - Get what day of the week a day is by simply choosing a year, a month and a day while discovering the potential of Pyrubrum page menus.
  • Hitchhiker - Come to know how media are handled with Pyrubrum and...get an existential question answered.
  • Sample - Interact with inline menus while understanding how Pyrubrum works.

Changelog

See CHANGELOG.md. Find new features in FEATURES.md.

Commit messages

See Conventional Commits.

Contributing

See CONTRIBUTING.md.

Versioning

See PEP 440.

Thanks

  • veggero/tytg for giving me the idea of developing a simple framework with which you can code a folder-like bot.
  • bakhoraliev for letting me understand that an object-oriented library would make the difference in developing this project.

Branding

See hearot/pyrubrum-assets.

Copyright & License

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

pyrubrum-continued-0.2.13.tar.gz (248.7 kB view details)

Uploaded Source

Built Distribution

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

pyrubrum_continued-0.2.13-py3-none-any.whl (69.0 kB view details)

Uploaded Python 3

File details

Details for the file pyrubrum-continued-0.2.13.tar.gz.

File metadata

  • Download URL: pyrubrum-continued-0.2.13.tar.gz
  • Upload date:
  • Size: 248.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for pyrubrum-continued-0.2.13.tar.gz
Algorithm Hash digest
SHA256 cda509de782079ae4666354d9a234a345eefb86abfbb67215df91ff57e28580c
MD5 c80e2ddf10ac7970993a55db4189e958
BLAKE2b-256 9db7eef6fb942d59bd5b14c463eacf320601a3b7e9c0183a56f2356067243d4e

See more details on using hashes here.

File details

Details for the file pyrubrum_continued-0.2.13-py3-none-any.whl.

File metadata

File hashes

Hashes for pyrubrum_continued-0.2.13-py3-none-any.whl
Algorithm Hash digest
SHA256 a485cd02c306eb4b7cd71f534b430c83d250a9ec4e7c96f5b684f530815d7a33
MD5 744a8f636669dcccb6e9cc09ac8bf40d
BLAKE2b-256 1352b5b87624561fb851b5258f2abe0e2e31b3fef59cc1f29201602ad8bbb1c7

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