From 71733de05f6ee92d1b21e1c52a85f90339e37dfe Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Tue, 10 Sep 2024 12:59:00 -0700 Subject: [PATCH] enhance DM/Channel logic for llm fix logic for DM or Channel Sending --- mesh_bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index 2e603d3..308e914 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -137,7 +137,7 @@ def handle_llm(message_from_id, channel_number, deviceID, message, publicChannel # if the message_from_id is not in the llmLocationTable send the welcome message if not message_from_id in llmLocationTable: - if channel_number == publicChannel: + if (channel_number == publicChannel and antiSpam) or useDMForResponse: # send via DM send_message(welcome_message, channel_number, message_from_id, deviceID) time.sleep(responseDelay) @@ -159,7 +159,7 @@ def handle_llm(message_from_id, channel_number, deviceID, message, publicChannel averageRuntime = sum(llmTotalRuntime) / len(llmTotalRuntime) if averageRuntime > 25: msg = f"Please wait, average query time is: {int(averageRuntime)} seconds" - if channel_number == publicChannel: + if (channel_number == publicChannel and antiSpam) or useDMForResponse: # send via DM send_message(msg, channel_number, message_from_id, deviceID) time.sleep(responseDelay) @@ -169,7 +169,7 @@ def handle_llm(message_from_id, channel_number, deviceID, message, publicChannel time.sleep(responseDelay) else: msg = "Please wait, response could take 30+ seconds. Fund the SysOp's GPU budget!" - if channel_number == publicChannel: + if (channel_number == publicChannel and antiSpam) or useDMForResponse: # send via DM send_message(msg, channel_number, message_from_id, deviceID) time.sleep(responseDelay)