Allow /stop without target argument
This commit is contained in:
@@ -96,11 +96,10 @@ class Bridge:
|
||||
|
||||
def _handle_command(self, action: str, target: str, channel: str) -> None:
|
||||
"""슬래시 커맨드를 처리한다."""
|
||||
if target not in {"claude", "codex"}:
|
||||
self.slack.send_message(channel, ":warning: 지원하지 않는 대상입니다.")
|
||||
return
|
||||
|
||||
if action == "start":
|
||||
if target not in {"claude", "codex"}:
|
||||
self.slack.send_message(channel, ":warning: 지원하지 않는 대상입니다.")
|
||||
return
|
||||
self._start_session(channel, target)
|
||||
elif action == "stop":
|
||||
self._stop_session(channel)
|
||||
|
||||
@@ -86,23 +86,12 @@ class SlackHandler:
|
||||
ack()
|
||||
user_id = body.get("user_id", "")
|
||||
channel_id = body.get("channel_id", "")
|
||||
target = self._parse_target(body.get("text", ""))
|
||||
|
||||
if not self._is_authorized(user_id, channel_id):
|
||||
return
|
||||
|
||||
if target is None:
|
||||
self.send_message(
|
||||
channel_id,
|
||||
(
|
||||
":warning: 대상은 `claude` 또는 `codex`여야 합니다. "
|
||||
"예: `/stop claude`"
|
||||
),
|
||||
)
|
||||
return
|
||||
|
||||
if self._on_command_callback:
|
||||
self._on_command_callback("stop", target, channel_id)
|
||||
self._on_command_callback("stop", "", channel_id)
|
||||
|
||||
@staticmethod
|
||||
def _parse_target(text: str) -> str | None:
|
||||
|
||||
Reference in New Issue
Block a user