mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-22 00:14:10 +00:00
Add #270
This commit is contained in:
parent
be726cc955
commit
f34643f77c
|
@ -147,7 +147,7 @@ def day_overview(client):
|
|||
if "actionhidden" in item or "suppressed" in item or "userhidden" in item:
|
||||
continue # while such actions have type value (edit/new/log) many other values are hidden and therefore can crash with key error, let's not process such events
|
||||
activity = add_to_dict(activity, item["user"])
|
||||
hours = add_to_dict(hours, datetime.datetime.strptime(item["timestamp"], "%Y-%m-%dT%H:%M:%SZ").hour)
|
||||
hours = add_to_dict(hours, datetime.datetime.strptime(item["timestamp"], "%Y-%m-%dT%H:%M:%SZ").replace(minute=0, second=0, tzinfo=datetime.timezone.utc))
|
||||
if item["type"] == "edit":
|
||||
edits += 1
|
||||
changed_bytes += item["newlen"] - item["oldlen"]
|
||||
|
@ -171,8 +171,8 @@ def day_overview(client):
|
|||
v = hours.values()
|
||||
active_hours = []
|
||||
for hour, numberh in Counter(hours).most_common(list(v).count(max(v))): # find most active hours
|
||||
active_hours.append(str(hour))
|
||||
houramount = ngettext(" UTC ({} action)", " UTC ({} actions)", numberh).format(numberh)
|
||||
active_hours.append("<t:"+str(int(hour.timestamp()))+":t>")
|
||||
houramount = ngettext(" ({} action)", " ({} actions)", numberh).format(numberh)
|
||||
else:
|
||||
active_users = active_hours = [_("But nobody came")] # a reference to my favorite game of all the time, sorry ^_^
|
||||
usramount = houramount = ""
|
||||
|
|
Loading…
Reference in a new issue