Skip to main content

Keyboard for Pyrogram number one.

Project description

pyroboard

PyPI Downloads GitHub

Pyroboard

Renamed version of popular Pykeyboard keyboard framework

What's new?

  • Added a new method to InlineKeyboard for working with pagination. The InlinePaginationKeyboard class will be removed in a future version.

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.types 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.types 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

Pagination inline keyboard

from pyroboard import InlineKeyboard

Parameters:

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

Pagination 3 pages

Code

from pyroboard import InlineKeyboard

keyboard = InlineKeyboard()
keyboard.paginate(3, 3, 'pagination_keyboard#{number}')

Result

pagination_keyboard_3

Pagination 5 pages

Code

from pyroboard import InlineKeyboard

keyboard = InlineKeyboard()
keyboard.paginate(5, 3, 'pagination_keyboard#{number}')

Result

pagination_keyboard_5

Pagination 9 pages

Code

from pyroboard import InlineKeyboard

keyboard = InlineKeyboard()
keyboard.paginate(9, 5, 'pagination_keyboard#{number}')

Result

pagination_keyboard_9

Pagination 100 pages

Code

from pyroboard import InlineKeyboard

keyboard = InlineKeyboard()
keyboard.paginate(100, 100, 'pagination_keyboard#{number}')

Result

pagination_keyboard_100

Pagination 150 pages and buttons

Code

from pyroboard import InlineKeyboard
from pyrogram.types import InlineKeyboardButton

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

Result

pagination_keyboard_150

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.types 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.types 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

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.2.tar.gz (4.8 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: pyroboard-0.1.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.0

File hashes

Hashes for pyroboard-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9588d6b7703b3ad92893cf40d29ac2b878130cbe3006300d8a4da412fc84c5ef
MD5 88e218fc9d5a7f19e6eb91e3c8a992f4
BLAKE2b-256 c76f35cd076e4da84efe09370e311066287180d84abcfe7a2e482276d86e8671

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