Преглед на файлове

Fixing yet another date math error

main
Rocketsoup преди 1 месец
родител
ревизия
fe199cec58
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1
    1
      rocketbot/cogs/crosspostcog.py

+ 1
- 1
rocketbot/cogs/crosspostcog.py Целия файл

@@ -211,7 +211,7 @@ class CrossPostCog(BaseCog, name='Crosspost Detection'):
211 211
 			Storage.set_state_value(message.guild, self.STATE_KEY_SPAM_CONTEXT, spam_lookup)
212 212
 		key = f'{message.author.id}'
213 213
 		context = spam_lookup.get(key)
214
-		if context is not None and message.created_at - context.age > max_age:
214
+		if context is not None and message.created_at.timestamp() - context.age.timestamp() > max_age.total_seconds():
215 215
 			context = None
216 216
 		if context is None:
217 217
 			context = SpamContext(message.author)

Loading…
Отказ
Запис