Skip to main content

Keyboard for Pyrogram number one.

Project description

pyroboard

PyPI Downloads GitHub

Pyroboard

Renamed version of popular Pykeyboard keyboard framework

Installation

pip install pyroboard

Documentation

Inline Keyboard

from pyroboard import InlineKeyboard

Parameters:

  • row_width (integer, default 3)

Inline Keyboard add buttons

Code

from pyroboard import InlineKeyboard
from pyrogram import InlineKeyboardButton


keyboard = InlineKeyboard(row_width=3)
keyboard.add(
    InlineKeyboardButton('1', 'inline_keyboard#1'),
    InlineKeyboardButton('2', 'inline_keyboard#2'),
    InlineKeyboardButton('3', 'inline_keyboard#3'),
    InlineKeyboardButton('4', 'inline_keyboard#4'),
    InlineKeyboardButton('5', 'inline_keyboard#5'),
    InlineKeyboardButton('6', 'inline_keyboard#6'),
    InlineKeyboardButton('7', 'inline_keyboard#7')
)

Result

add_inline_button

Inline Keyboard row buttons

Code

from pyroboard import InlineKeyboard
from pyrogram import InlineKeyboardButton


keyboard = InlineKeyboard()
keyboard.row(InlineKeyboardButton('1', 'inline_keyboard#1'))
keyboard.row(
    InlineKeyboardButton('2', 'inline_keyboard#2'),
    InlineKeyboardButton('3', 'inline_keyboard#3')
)
keyboard.row(InlineKeyboardButton('4', 'inline_keyboard#4'))
keyboard.row(
    InlineKeyboardButton('5', 'inline_keyboard#5'),
    InlineKeyboardButton('6', 'inline_keyboard#6')
)

Result

row_inline_button

Reply Keyboard

from pyroboard import ReplyKeyboard

Parameters:

  • resize_keyboard (bool, optional)
  • one_time_keyboard (bool, optional)
  • selective (bool, optional)
  • row_width (integer, default 3)

Reply Keyboard add buttons

Code

from pyroboard import ReplyKeyboard
from pyrogram import KeyboardButton


keyboard = ReplyKeyboard(row_width=3)
keyboard.add(
    KeyboardButton('1', 'reply_keyboard#1'),
    KeyboardButton('2', 'reply_keyboard#2'),
    KeyboardButton('3', 'reply_keyboard#3'),
    KeyboardButton('4', 'reply_keyboard#4'),
    KeyboardButton('5', 'reply_keyboard#5'),
)

Result

add_reply_button

Reply Keyboard row buttons

Code

from pyroboard import ReplyKeyboard
from pyrogram import KeyboardButton


keyboard = ReplyKeyboard()
keyboard.row(KeyboardButton('1', 'reply_keyboard#1'))
keyboard.row(
    KeyboardButton('2', 'reply_keyboard#2'),
    KeyboardButton('3', 'reply_keyboard#3')
)
keyboard.row(KeyboardButton('4', 'reply_keyboard#4'))
keyboard.row(KeyboardButton('5', 'reply_keyboard#5'))

Result

row_reply_button

Pagination inline keyboard

from pyroboard import InlinePaginationKeyboard

Parameters:

  • count_pages (integer)
  • current_page (integer)
  • callback_pattern (string) - use of the {number} pattern is required

Pagination 3 pages

Code

from pyroboard import InlinePaginationKeyboard


keyboard = InlinePaginationKeyboard(3, 3, 'pagination_keyboard#{number}')

Result

pagination_keyboard_3

Pagination 5 pages

Code

from pyroboard import InlinePaginationKeyboard


keyboard = InlinePaginationKeyboard(5, 3, 'pagination_keyboard#{number}')

Result

pagination_keyboard_5

Pagination 9 pages

Code

from pyroboard import InlinePaginationKeyboard


keyboard = InlinePaginationKeyboard(9, 5, 'pagination_keyboard#{number}')

Result

pagination_keyboard_9

Pagination 100 pages

Code

from pyroboard import InlinePaginationKeyboard


keyboard = InlinePaginationKeyboard(100, 100, 'pagination_keyboard#{number}')

Result

pagination_keyboard_100

Pagination 150 pages and buttons

Code

from pyroboard import InlinePaginationKeyboard
from pyrogram import InlineKeyboardButton


keyboard = InlinePaginationKeyboard(150, 123, 'pagination_keyboard#{number}')
keyboard.row(
    InlineKeyboardButton('Back', 'pagination_keyboard#back'),
    InlineKeyboardButton('Close', 'pagination_keyboard#close')
)

Result

pagination_keyboard_150

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

pyroboard-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file pyroboard-0.1.0.tar.gz.

File metadata

  • Download URL: pyroboard-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for pyroboard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9078545781d997b1fcdd6372dd69a2c72cc37c9251047e2bb7f8ab6de3c77bf0
MD5 18ba847cbc2139dea1fde62213a7544e
BLAKE2b-256 9d75fa60c3935df0f9e091702e1c9ea991cca1df49479bf2824d7eea0da2c9db

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page