fixed notifications for multiple people on same map

This commit is contained in:
jenz 2026-02-17 12:12:34 +01:00
parent 3b0ba15b6a
commit ec865993d5

View File

@ -177,11 +177,18 @@ def check_new_map_notification_status(fixed, last_msg_id):
return valid_map_notification_cmds_add, valid_map_notification_cmds_remove, invalid_map_notification_cmds, last_msg_id, show_map_notifications
def send_post_notify_message_to_stoat(list_of_people_to_notify, infomap):
#print('list_of_people_to_notify: ', list_of_people_to_notify)
list_of_people_to_notify = list_of_people_to_notify[0]
message = f"Map changed to: {infomap}\n\n"
try:
list_of_people_to_notify = json.loads(list_of_people_to_notify)
except:
#in case it fails there should be nobody to notify
return
#print('list_of_people_to_notify: ', list_of_people_to_notify)
for people in list_of_people_to_notify:
if not people or people == "[]": continue
people = people.replace('["', '').replace('"]', '')
#print('people: ', people)
message += f"<@{people}> "
if not message.endswith("\n"):
message += "\n"