Spaces:
Paused
Paused
Download Powers/utils/kbhelpers.py from Dragdev/telegrambot: direct link, hf CLI and curl.
- Browser
- Download file 486 Bytes
-
https://huggingface.co/spaces/Dragdev/telegrambot/resolve/df6144993febe4688decfaa6700a97dfd70ca46f/Powers/utils/kbhelpers.py
- Command line
-
hf download hf://spaces/Dragdev/telegrambot@df6144993febe4688decfaa6700a97dfd70ca46f/Powers/utils/kbhelpers.py
-
curl -L -o kbhelpers.py https://huggingface.co/spaces/Dragdev/telegrambot/resolve/df6144993febe4688decfaa6700a97dfd70ca46f/Powers/utils/kbhelpers.py
486 Bytes
| from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup | |
| def btn(text, value, type="callback_data"): | |
| return InlineKeyboardButton(text, **{type: value}) | |
| def ikb(rows=None): | |
| if rows is None: | |
| rows = [] | |
| lines = [] | |
| for row in rows: | |
| line = [] | |
| for button in row: | |
| button = btn(*button) # InlineKeyboardButton | |
| line.append(button) | |
| lines.append(line) | |
| return InlineKeyboardMarkup(inline_keyboard=lines) | |