aboutsummaryrefslogtreecommitdiffstats
path: root/slack/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'slack/util.py')
-rw-r--r--slack/util.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/slack/util.py b/slack/util.py
index 8738748..8dfc967 100644
--- a/slack/util.py
+++ b/slack/util.py
@@ -1,15 +1,13 @@
from __future__ import annotations
-from typing import Callable, Dict, Union
+from typing import Callable
import weechat
-from slack.shared import shared
+from slack.shared import WeechatCallbackReturnType, shared
-weechat_callback_return_type = Union[int, str, Dict[str, str], None]
-
-def get_callback_name(callback: Callable[..., weechat_callback_return_type]) -> str:
+def get_callback_name(callback: Callable[..., WeechatCallbackReturnType]) -> str:
callback_id = f"{callback.__name__}-{id(callback)}"
shared.weechat_callbacks[callback_id] = callback
return callback_id