You stored the warnings in a really bad way, it's not difficult to do that, but it's chunky and it's not the best way
# Harcoding so it's easier to visualize
warn_ids = [49926, 84348, 55828]
mods = [81730981793807198, 81730981793807198, 81730981793807198]
reasons = ["reason1", "reason2", "reason3"]
warn_times = ["Wednesday, January 27 2021 @ 20:32:55 PM", "Wednesday, January 27 2021 @ 20:32:55 PM", "Wednesday, January 27 2021 @ 20:32:55 PM"]
warn_ids = [12345, 54321, 123654]
warns = 3
print(f"Total warnings: {warns}")
for warn_id, mod, reason, warn_time, warn_id in zip(warn_ids, mods, reasons, warn_times, warn_ids):
print(f"ID: {warn_id}, mod: {mod}, reason: {reason}, time: {warn_time}")
Output:
Total warnings: 3
ID: 49926, mod: 81730981793807198, reason: reason1, time: Wednesday, January 27 2021 @ 20:32:55 PM
ID: 54321, mod: 81730981793807198, reason: reason2, time: Wednesday, January 27 2021 @ 20:32:55 PM
ID: 123654, mod: 81730981793807198, reason: reason3, time: Wednesday, January 27 2021 @ 20:32:55 PM
I personally would use the following JSON format
{
"1929291823719827398": [
{"id": 123, "mod": 91823091823012339, "reason": "reason1", "timestamp": "12:34:12 01:01:2021"},
{"id": 124, "mod": 19182309182309183, "reason": "reason2", "timestamp": "12:45:45 10:01:2021"},
{"id": 125, "mod": 76187326198632893, "reason": "reason3", "timestamp": "20:12:54 13:01:2021"}
]
}
It's a lot easier now to read each indivitual warning, let me show an example
with open("path.json", "r") as f:
data = json.load(f)
user_data = data[str(some_id)]
print(f"Total warnings: {len(user_data)}")
for warn in user_data:
warn_id, mod, reason, time = warn.values()
print(f"ID: {warn_id}, mod: {mod}, reason: {reason}, time: {time}")
Output:
Total warnings: 3
ID: 123, mod: 91823091823012339, reason: reason1, time: 12:34:12 01:01:2021
ID: 124, mod: 19182309182309183, reason: reason2, time: 12:45:45 10:01:2021
ID: 125, mod: 76187326198632893, reason: reason3, time: 20:12:54 13:01:2021
PS: Also sorry for a lot of code :)