fixed notifications for multiple people on same map
This commit is contained in:
parent
3b0ba15b6a
commit
ec865993d5
@ -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
|
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):
|
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"
|
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:
|
for people in list_of_people_to_notify:
|
||||||
if not people or people == "[]": continue
|
if not people or people == "[]": continue
|
||||||
people = people.replace('["', '').replace('"]', '')
|
people = people.replace('["', '').replace('"]', '')
|
||||||
|
#print('people: ', people)
|
||||||
message += f"<@{people}> "
|
message += f"<@{people}> "
|
||||||
if not message.endswith("\n"):
|
if not message.endswith("\n"):
|
||||||
message += "\n"
|
message += "\n"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user