diff --git a/main.py b/main.py index b3b3019..9fc0e55 100644 --- a/main.py +++ b/main.py @@ -22,6 +22,7 @@ api_file.close() # Enable to use dummy DEBUG_MODE = False + def main() -> None: wrap = ClientWrapper() @@ -66,6 +67,7 @@ class ClientWrapper(object): We only ever expect one of these. Holds a slack client, and handles messsages. """ + def __init__(self): # Init slack if DEBUG_MODE: diff --git a/slack_util.py b/slack_util.py index c93d427..365b1c9 100644 --- a/slack_util.py +++ b/slack_util.py @@ -4,7 +4,7 @@ import re from slackclient import SlackClient import channel_util -from typing import Any, Optional, Generator, Match, Callable, List, Awaitable +from typing import Any, Optional, Generator, Match, Callable, List, Awaitable, Coroutine """ Slack helpers. Separated for compartmentalization @@ -84,7 +84,7 @@ def message_stream(slack: SlackClient) -> Generator[dict, None, None]: class Hook(object): def __init__(self, - callback: Callable[[SlackClient, dict, Match], Awaitable[None]], # TODO: Fix this type + callback: Coroutine[[SlackClient, dict, Match]], pattern: str = None, channel_whitelist: Optional[List[str]] = None, channel_blacklist: Optional[List[str]] = None):