keiffster / program-y

Python 3.x based AIML 2.0 Chatbot interpreter, framework, related programs and knowledge files
https://keiffster.github.io/program-y/
Other
349 stars 137 forks source link

scheduling extension doesn't print message #289

Open shagho opened 3 years ago

shagho commented 3 years ago

I write a program with your library that's work with embedbasicbot and i use scheduling grammar and doesn't work(doesn't print any thing) and i investigate the codes of scheduling that's work but just doesn't print so i use two library, one for seeing the message as notification and other for make a sound(beepy and notify) below is code that i changed:

def scheduled(self, userid, clientid, action, text):
        YLogger.debug(None, "Processing Scheduled Event [%s] [%s] [%s] [%s] [%s]",
                      self.name, userid, clientid, action, text)
        client_context = self._client.create_client_context(userid)
        if action == 'TEXT':
            notification(text)
            beep(sound=4)
        elif action == 'SRAI':
            response = client_context.bot.ask_question(client_context, text)
            self._client.render_response(client_context, response)
        else:
            YLogger.error(client_context, "Unknown scheduler command [%s]", action)