Skip to content

Commit

Permalink
fix collector decorators signature
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidnev Nikolaj committed Aug 11, 2019
1 parent 1b357d5 commit e204431
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 33 deletions.
23 changes: 17 additions & 6 deletions botx/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,21 +147,27 @@ def hidden_command_handler(
)

def file_handler(
self, callback: Callable, dependencies: Optional[List[Callable]] = None
self,
callback: Optional[Callable] = None,
*,
dependencies: Optional[List[Callable]] = None,
) -> Callable:
return self.handler(
callback,
callback=callback,
name=FILE_HANDLER_NAME,
command=SYSTEM_FILE_TRANSFER,
exclude_from_status=True,
dependencies=dependencies,
)

def default_handler(
self, callback: Callable, dependencies: Optional[List[Callable]] = None
self,
callback: Optional[Callable] = None,
*,
dependencies: Optional[List[Callable]] = None,
) -> Callable:
return self.handler(
callback,
callback=callback,
command=DEFAULT_HANDLER_BODY,
use_as_default_handler=True,
dependencies=dependencies,
Expand All @@ -185,8 +191,13 @@ def system_event_handler(
)

def chat_created_handler(
self, callback: Callable, dependencies: Optional[List[Callable]] = None
self,
callback: Optional[Callable] = None,
*,
dependencies: Optional[List[Callable]] = None,
) -> Callable:
return self.system_event_handler(
callback, event=SystemEventsEnum.chat_created, dependencies=dependencies
callback=callback,
event=SystemEventsEnum.chat_created,
dependencies=dependencies,
)
Loading

0 comments on commit e204431

Please sign in to comment.