From 4b004a356aec12eb59fb4c5a208c21d3817ef9d7 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Mon, 24 Oct 2022 22:29:03 +0200 Subject: Add callbacks to global scope --- slack/util.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 slack/util.py (limited to 'slack/util.py') diff --git a/slack/util.py b/slack/util.py new file mode 100644 index 0000000..10d4ce9 --- /dev/null +++ b/slack/util.py @@ -0,0 +1,8 @@ +from typing import Any, Callable + +import globals as G + + +def get_callback_name(callback: Callable[..., Any]) -> str: + G.weechat_callbacks[callback.__name__] = callback + return callback.__name__ -- cgit