diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-01-21 02:35:36 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:53 +0100 |
commit | ec5e23bd7a6a928a1b0aa28fadc9b6554c7b2641 (patch) | |
tree | 45e0a8385cb619e124ccaf93ddd00c6a7c88e658 /slack/commands.py | |
parent | 3ae792a3cd858261c3b8fc7a0e1cdd9fa570096e (diff) | |
download | wee-slack-ec5e23bd7a6a928a1b0aa28fadc9b6554c7b2641.tar.gz |
Add a /slack debug command
Diffstat (limited to 'slack/commands.py')
-rw-r--r-- | slack/commands.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/slack/commands.py b/slack/commands.py index 457d43e..41abbde 100644 --- a/slack/commands.py +++ b/slack/commands.py @@ -1,5 +1,6 @@ from __future__ import annotations +import pprint import re from dataclasses import dataclass from functools import wraps @@ -211,6 +212,21 @@ def command_slack_workspace_del( ) +@weechat_command("tasks|buffer") +def command_slack_debug( + buffer: str, args: List[str], options: Dict[str, Optional[str]] +): + if args[0] == "tasks": + weechat.prnt("", "Active tasks:") + weechat.prnt("", pprint.pformat(shared.active_tasks)) + weechat.prnt("", "Active futures:") + weechat.prnt("", pprint.pformat(shared.active_futures)) + elif args[0] == "buffer": + conversation = get_conversation_from_buffer_pointer(buffer) + if conversation: + weechat.prnt("", f"Conversation id: {conversation.id}") + + def completion_slack_workspaces_cb( data: str, completion_item: str, buffer: str, completion: str ) -> int: |