Skip to main content

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

Metadata

Release files for pyrubrum-continued 0.2.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyrubrum-continued 0.2.22
File Size Uploaded
pyrubrum-continued-0.2.22.tar.gz 54.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyrubrum-continued 0.2.22
File Interpreter ABI Platform
pyrubrum_continued-0.2.22-py3-none-any.whl Python 3 none any Details

Total release size: 123.2 kB

Release files / pyrubrum-continued-0.2.22.tar.gz

Download URL pyrubrum-continued-0.2.22.tar.gz
Size 54.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b3d8a2261e9c5f28d7b2d74c689d747e6419782763448a30e9c93b763600560f
BLAKE2b-256 checksum
How to use checksums
d4fa44bda07dac5a9b9a3e3a35edff81c394d86bbb60b0ff0bf33fc97c44c942
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pyrubrum_continued-0.2.22-py3-none-any.whl

Download URL pyrubrum_continued-0.2.22-py3-none-any.whl
Size 69.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad6d5b880a44978f9ac8af2be0d04679f26b309d679c441e90b04ec327fc654d
BLAKE2b-256 checksum
How to use checksums
6029915b0593ba21827da0cfa29dfa7848f3993e6e4b0de7de06195b4d02ddac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.2.22 This release

2 release files

0.2.19

2 release files

0.2.18

2 release files

0.2.17

2 release files

0.2.16

2 release files

0.2.15

2 release files

0.2.14

2 release files

0.2.13

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page