-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathinteractive_buttons.py
More file actions
43 lines (37 loc) · 1.07 KB
/
interactive_buttons.py
File metadata and controls
43 lines (37 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from whatsapp_chatbot_python import GreenAPIBot, Notification
bot = GreenAPIBot(
"1101000001", "d75b3a66374942c5b3c019c698abc2067e151558acbd412345"
)
@bot.router.message()
def show_interactive_buttons_handler(notification: Notification) -> None:
notification.answer_with_interactive_buttons(
"This message contains interactive buttons",
[{
"type": "call",
"buttonId": "1",
"buttonText": "Call me",
"phoneNumber": "79123456789"
},
{
"type": "url",
"buttonId": "2",
"buttonText": "Green-api",
"url": "https://green-api.com"
}],
"Hello!",
"Hope you like it!"
)
notification.answer_with_interactive_buttons_reply(
"This message contains interactive reply buttons",
[{
"buttonId": "1",
"buttonText": "First Button"
},
{
"buttonId": "2",
"buttonText": "Second Button"
}],
"Hello!",
"Hope you like it!"
)
bot.run_forever()