DonDebonair/slack-machine

Information ? Scheduling and Listen_to

dorel14 opened this issue · 1 comments

Hello
For the same fonction , i'd like to schedule thsi function and also have the possibility to force this function with a listen_to command

'class synchroAgenda(MachineBasePlugin):
"""Classe de gestion d'imports des evenements du calendrier support dans la
base de donnée pour affichage dans grafana"""
@listen_to(r"synchro agenda")
@schedule(hour='21', minute='05')'

When i try this i have an error message
Traceback (most recent call last): File "/home/devsupportbot/lib/python3.6/site-packages/machine/utils/pool.py", line 21, in run func(*args, **kargs) File "/home/devsupportbot/lib/python3.6/site-packages/machine/dispatch.py", line 50, in handle_event self._dispatch_listeners(listeners, event) File "/home/devsupportbot/lib/python3.6/site-packages/machine/dispatch.py", line 104, in _dispatch_listeners l['function'](message, **match.groupdict()) TypeError: sync_agenda() takes 1 positional argument but 2 were given

Auto find solution
class synchroAgenda(MachineBasePlugin):
"""Classe de gestion d'imports des evenements du calendrier support dans la
base de donnée pour affichage dans grafana"""
@listen_to(r"synchro agenda")
@schedule(hour='21', minute='05')
def sync_agenda(self, *kwargs):