fixMessagesCommand

thanks @mesb1  https://github.com/SpudGunMan/meshing-around/issues/200
This commit is contained in:
SpudGunMan
2025-10-07 13:48:23 -07:00
parent e621016e9a
commit b8e9adb223
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -137,7 +137,7 @@ git clone https://github.com/spudgunman/meshing-around
| Command | Description | |
|---------|-------------|-
| `askai` and `ask:` | Ask Ollama LLM AI for a response. Example: `askai what temp do I cook chicken` | ✅ |
| `messages` | Replays the last messages heard, like Store and Forward | ✅ |
| `messages` | Replays the last messages heard on device, like Store and Forward, returns the PublicChannel and Current | ✅ |
| `readnews` | returns the contents of a file (news.txt, by default) via the chunker on air | ✅ |
| `satpass` | returns the pass info from API for defined NORAD ID in config or Example: `satpass 25544,33591`| |
| `wiki:` | Searches Wikipedia and returns the first few sentences of the first result if a match. Example: `wiki: lora radio` |
+4
View File
@@ -962,6 +962,10 @@ def handle_messages(message, deviceID, channel_number, msg_history, publicChanne
else:
response = ""
for msgH in msg_history:
# number of messages to return
if len(response.split("\n"))/2 >= storeFlimit:
break
# if the message is for this deviceID and channel or publicChannel
if msgH[4] == deviceID:
if msgH[2] == channel_number or msgH[2] == publicChannel:
response += f"\n{msgH[0]}: {msgH[1]}"