class ActionPayrollandattMenu(Action): def name(self) → Text: return “action_payroll”
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
message = "Please select your preferred option:"
buttons = [
{"title": "Payroll", "id": "Payroll"},
{"title": "Attendance", "id": "Attendance"},
]
#print("Tracker.Event",tracker.events,"\n\n")
language = tracker.slots.get("language")
#print(f"language: {language}")
if language and language != "en":
translator = Translator()
message = translator.translate("Please select your preferred option:", dest=language).text
else:
message = "Please select your preferred option:"
buttons = [
{"title": "Payroll", "id": "Payroll"},
{"title": "Attendance", "id": "Attendance"}
]
for button in buttons:
if language and language != "en":
button["title"] = translator.translate(button["title"], dest=language).text
dispatcher.utter_message(text=message, buttons=buttons)
IST = pytz.timezone('Asia/Kolkata')
date = (datetime.datetime.now(IST) + datetime.timedelta(minutes=2)).strftime("%Y-%m-%d %H:%M:%S")
entities = tracker.latest_message.get("entities")
date = datetime.datetime.strptime(date,"%Y-%m-%d %H:%M:%S")
reminder=remind(date,entities)
return [reminder]
here if i type instead of selecting buttons and it is not related to the Attendance and Payroll intents. i want to show that action_payroll again.