Update Slack message text fallback response

Slack doesn't accept an empty string in the `text` parameter. However, Nanobot sometimes sends an empty response. This may need a change in the bot's logic as well; still, it should also be handled by the channel. I suggest changing the default message to '<empty_response_from_the_bot>' when the content is empty, so the user will know that the bot was trying to respond with an empty message.
This commit is contained in:
Aleksander W. Oleszkiewicz (Alek)
2026-02-15 13:51:17 +01:00
committed by GitHub
parent 69f80ec634
commit d07e0c1f79

View File

@@ -84,7 +84,7 @@ class SlackChannel(BaseChannel):
use_thread = thread_ts and channel_type != "im"
await self._web_client.chat_postMessage(
channel=msg.chat_id,
text=msg.content or "",
text=msg.content or "<empty_response_from_the_bot>",
thread_ts=thread_ts if use_thread else None,
)
except Exception as e: