Skip to main content

Best Keyboard and Pagination for the Pyrogram Library.

Project description

Pykeyboard

PyPI Downloads GitHub

Installation

pip install pykeyboard

Documentation

Inline Keyboard

from pykeyboard import InlineKeyboard

Parameters:

  • row_width (integer, default 3)

Inline Keyboard add buttons

Code
from pykeyboard 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 pykeyboard 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

Reply Keyboard

from pykeyboard 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 pykeyboard 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 pykeyboard 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

Pagination inline keyboard

from pykeyboard import InlinePaginationKeyboard

Parameters:

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

Pagination 3 pages

Code
from pykeyboard import InlinePaginationKeyboard


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

pagination_keyboard_3

Pagination 5 pages

Code
from pykeyboard import InlinePaginationKeyboard


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

pagination_keyboard_5

Pagination 9 pages

Code
from pykeyboard import InlinePaginationKeyboard


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

pagination_keyboard_9

Pagination 25 pages

Code
from pykeyboard import InlinePaginationKeyboard


keyboard = InlinePaginationKeyboard(25, 14, 'pagination_keyboard#{number}')
Result

pagination_keyboard_25

Pagination 100 pages

Code
from pykeyboard import InlinePaginationKeyboard


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

pagination_keyboard_100

Pagination 150 pages and buttons

Code
from pykeyboard import InlinePaginationKeyboard
from pyrogram.types 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

pykeyboard-0.1.1.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file pykeyboard-0.1.1.tar.gz.

File metadata

  • Download URL: pykeyboard-0.1.1.tar.gz
  • Upload date:
  • Size: 4.6 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 pykeyboard-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a0f939d8c77924ac5bb77e2a7db1f65a6bdfc33abd94b019fc47acff1dd8a0d1
MD5 a99be86590b86a7cce90ed0ee821b8db
BLAKE2b-256 8204f9d2cd2111beefddf0d138740f69fadba6e79b33fd557c5bc318f1e729fc

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