resolve edge case where get_channel_number() would return zero and the bot would respond in the public channel despite being unconfigured.

This commit is contained in:
agessaman
2025-11-02 16:57:25 -08:00
parent b773dcd0a1
commit ee0ceb667b
2 changed files with 16 additions and 3 deletions
+5
View File
@@ -283,6 +283,11 @@ class CommandManager:
# Get channel number from channel name
channel_num = self.bot.channel_manager.get_channel_number(channel)
# Check if channel was found (None indicates channel name not found)
if channel_num is None:
self.logger.error(f"Channel '{channel}' not found. Cannot send message.")
return False
self.logger.info(f"Sending channel message to {channel} (channel {channel_num}): {content}")
# Use meshcore-cli send_chan_msg function