File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
whatsapp_chatbot_python/manager Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 11from whatsapp_chatbot_python import GreenAPIBot , Notification
22
33bot = GreenAPIBot (
4- "1101000001 " , "d75b3a66374942c5b3c019c698abc2067e151558acbd412345 "
4+ "7105246622 " , "c880070976f64f8797484d14819276a457f481a327d64f9da4 "
55)
66
77
@@ -77,11 +77,23 @@ def show_interactive_buttons_reply_handler(notification: Notification) -> None:
7777 "This message contains interactive reply buttons" ,
7878 [{
7979 "buttonId" : "1" ,
80- "buttonText" : "First Button "
80+ "buttonText" : "Report a problem "
8181 },
8282 {
8383 "buttonId" : "2" ,
84- "buttonText" : "Second Button"
84+ "buttonText" : "Show office address"
85+ },
86+ {
87+ "buttonId" : "3" ,
88+ "buttonText" : "Show available rates"
89+ },
90+ {
91+ "buttonId" : "4" ,
92+ "buttonText" : "Call a support operator"
93+ },
94+ {
95+ "buttonId" : "5" ,
96+ "buttonText" : "Show interactive buttons"
8597 }],
8698 "Hello!" ,
8799 "Hope you like it!"
Original file line number Diff line number Diff line change @@ -60,6 +60,8 @@ def get_message_text(self) -> Optional[str]:
6060 type_message = message_data ["typeMessage" ]
6161 if type_message == "textMessage" :
6262 return message_data ["textMessageData" ]["textMessage" ]
63+ if type_message == "interactiveButtonsResponse" :
64+ return message_data ["interactiveButtonsResponse" ]["selectedDisplayText" ]
6365 elif (
6466 type_message == "extendedTextMessage"
6567 or type_message == "quotedMessage"
You can’t perform that action at this time.
0 commit comments