aboutsummaryrefslogtreecommitdiffstats
path: root/slack/util.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2022-10-24 22:29:03 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:52 +0100
commit4b004a356aec12eb59fb4c5a208c21d3817ef9d7 (patch)
tree41ab637631d19f890afae937e42f03e8a339c1cd /slack/util.py
parentee9d976ff8d8910c091d1554dfa62ab28ad67509 (diff)
downloadwee-slack-4b004a356aec12eb59fb4c5a208c21d3817ef9d7.tar.gz
Add callbacks to global scope
Diffstat (limited to 'slack/util.py')
-rw-r--r--slack/util.py8
1 files changed, 8 insertions, 0 deletions
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__