mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 23:08:11 +00:00
Fix: tryBotReplyChannel must check bot_target_type == 0
Without the check, a DM-mode bot (bot_target_type==1) would also reply to channel messages whenever the trigger phrase and channel index happened to match. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,8 @@ void MyMesh::tryBotReplyDM(const ContactInfo& from, const char* text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MyMesh::tryBotReplyChannel(uint8_t channel_idx, const char* text) {
|
void MyMesh::tryBotReplyChannel(uint8_t channel_idx, const char* text) {
|
||||||
if (!(_prefs.bot_enabled && _prefs.bot_trigger[0] && _prefs.bot_reply[0] &&
|
if (!(_prefs.bot_enabled && _prefs.bot_target_type == 0 &&
|
||||||
|
_prefs.bot_trigger[0] && _prefs.bot_reply[0] &&
|
||||||
channel_idx == _prefs.bot_channel_idx &&
|
channel_idx == _prefs.bot_channel_idx &&
|
||||||
millis() - _bot_last_reply_ms > 10000UL))
|
millis() - _bot_last_reply_ms > 10000UL))
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user