Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import json
- def get_button(label, color, payload=""):
- return {
- "action": {
- "type": "text",
- "payload": json.dumps(payload),
- "label": label
- },
- "color": color
- }
- keyboard = {
- "one_time": False,
- "buttons": [
- [get_button(label="Кнопка 1", color="positive")],
- [get_button(label="Кнопка 2", color="negative")],
- [get_button(label="Кнопка 3", color="primary")],
- [get_button(label="Кнопка 4", color="default")]
- ]
- }
- keyboard = json.dumps(keyboard, ensure_ascii=False).encode('utf-8')
- keyboard = str(keyboard.decode('utf-8'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement