condense logging

This commit is contained in:
Nexus 2024-04-15 19:52:32 +01:00
parent 32725eb5a0
commit b64367710b
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -205,7 +205,7 @@ class QuoteQuota(commands.Cog):
for message in messages: for message in messages:
if filter_func(message): if filter_func(message):
age = now - message.created_at age = now - message.created_at
self.log.info("%r was a truth (%.2f seconds ago).", message, age.total_seconds()) self.log.info("%r was a truth (%.2f seconds ago).", message.id, age.total_seconds())
counts["all_time"] += 1 counts["all_time"] += 1
if message.created_at > now - timedelta(hours=1): if message.created_at > now - timedelta(hours=1):
counts["hour"] += 1 counts["hour"] += 1
@ -233,12 +233,12 @@ class QuoteQuota(commands.Cog):
# Pre 6:30pm 15th April, embeds were not tagged for detection. # Pre 6:30pm 15th April, embeds were not tagged for detection.
truth = any((_te.type == "rich" for _te in msg.embeds)) truth = any((_te.type == "rich" for _te in msg.embeds))
if truth: if truth:
self.log.info("Found untagged rich trump truth embed %r", msg) self.log.info("Found untagged rich trump truth embed: %r", msg.id)
return True return True
for __t_e in msg.embeds: for __t_e in msg.embeds:
if __t_e.type == "rich" and __t_e.colour.value == 0x5448EE: if __t_e.type == "rich" and __t_e.colour.value == 0x5448EE:
self.log.info("Found tagged rich trump truth embed %r", __t_e) self.log.info("Found tagged rich trump truth embed: %r", msg.id)
return True return True
return False return False