Hi,
I created a Telegram Bot in AppDaemon which is working fine with keyboard Callbacks. Now I want to save some User Input. Let’s say the user has 2 keyboard buttons to choose which variable to change. In the callback I know which variable was chosen, but the user input is just received as a new telegram_text.
How can I associate the response (telegram_text) with the chosen callback?
def _cmd_cange_variable(self,target_id):
msg = "Which value to change?\n\n"
keyboard_options=list()
keyboard_options.append({
'description': f"Test 1",
'url':f"/clb_change_variable?var=var1"})
keyboard_options.append({
'description': f"Test 2",
'url':f"/clb_change_variable?var=var2"})
def _clb_cange_variable(self,target_id,paramdict):
v = paramdict.get("var")
msg = f"What do you want to change {v} to?"
self._send_message(msg, target_id)
self.call_service(
'telegram_bot/answer_callback_query',
message=self._escape_markdown(msg),
callback_query_id=target_id)
The payload of the user input doesn’t reference the variable to change.