Skip to content

Commit

Permalink
Fix initial command handler setup
Browse files Browse the repository at this point in the history
  • Loading branch information
bb4L committed Dec 30, 2019
1 parent 2f9c7fc commit dbe703c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='telegram-task-bot',
version='0.0.6',
version='0.0.8',
license='BSD-3',
description='rpi-radio-alarm library',
long_description=open('README.md').read(),
Expand Down
5 changes: 3 additions & 2 deletions telegramtaskbot/Bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ def __init__(self, tasks: []):
self.cmd_fun[task.job_start_name] = task.start
self.cmd_fun[task.job_stop_name] = task.stop
self.default_button_list.extend(task.get_inline_keyboard())
self.dispatcher.add_handler(task.job_start_name, task.start, default_filter)
self.dispatcher.add_handler(task.job_stop_name, task.stop, default_filter)
if task.generic:
self.dispatcher.add_handler(CommandHandler(task.job_start_name, task.start, default_filter))
self.dispatcher.add_handler(CommandHandler(task.job_stop_name, task.stop, default_filter))

self.load_from_json()

Expand Down
1 change: 1 addition & 0 deletions telegramtaskbot/Task.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Task(object):
job_name: str
job_start_name: str
job_stop_name: str
generic: bool = False # defines if the task looks the same for each user
first_time = 0
repeat_time: timedelta = timedelta(seconds=5)
filename: str = ''
Expand Down

0 comments on commit dbe703c

Please sign in to comment.