aboutsummaryrefslogtreecommitdiffstats
path: root/slack/commands.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-10-15 15:35:26 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:54 +0100
commit094868a40f22aa09b412ef8db4ea2eb885433e0c (patch)
tree5bcdcb86756d2dd4dd32d35737c922f6da12be11 /slack/commands.py
parentf8fc75bc34565364591515eb8c87cacc8ddeb35f (diff)
downloadwee-slack-094868a40f22aa09b412ef8db4ea2eb885433e0c.tar.gz
Use one debug buffer for all debug logging
I will implement filtering like the /server raw buffer, instead of having multiple debug buffers.
Diffstat (limited to 'slack/commands.py')
-rw-r--r--slack/commands.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/slack/commands.py b/slack/commands.py
index 476c4ba..67c214a 100644
--- a/slack/commands.py
+++ b/slack/commands.py
@@ -10,7 +10,7 @@ from typing import Callable, Dict, List, Optional, Tuple
import weechat
from slack.error import SlackError, SlackRtmError, UncaughtError
-from slack.log import print_error
+from slack.log import open_debug_buffer, print_error
from slack.python_compatibility import format_exception, removeprefix, removesuffix
from slack.shared import shared
from slack.slack_buffer import SlackBuffer
@@ -297,7 +297,7 @@ def print_uncaught_error(
print_error("This error does not have any data")
-@weechat_command("tasks|buffer|open_ws_buffer|errors|error", split_all_args=True)
+@weechat_command("tasks|buffer|open_buffer|errors|error", split_all_args=True)
def command_slack_debug(
buffer: str, args: List[str], options: Dict[str, Optional[str]]
):
@@ -316,10 +316,8 @@ def command_slack_debug(
"",
f"Conversation id: {slack_buffer.parent.conversation.id}, Thread ts: {slack_buffer.parent.thread_ts}, Thread hash: {slack_buffer.parent.hash}",
)
- elif args[0] == "open_ws_buffer":
- slack_buffer = shared.buffers.get(buffer)
- if slack_buffer:
- slack_buffer.workspace.open_debug_ws_buffer()
+ elif args[0] == "open_buffer":
+ open_debug_buffer()
elif args[0] == "errors":
num_arg = int(args[1]) if len(args) > 1 and args[1].isdecimal() else 5
num = min(num_arg, len(shared.uncaught_errors))