Skip to content

Commit

Permalink
fix blocked, resolve #3131
Browse files Browse the repository at this point in the history
  • Loading branch information
fourjr committed Apr 19, 2022
1 parent d9c884e commit f03e203
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ however, insignificant breaking changes do not guarantee a major version bump, s
- Editing notes now work. ([GH #3094](https://github.com/kyb3r/modmail/issues/3094))
- Commands now work in threads.
- Audit log searching now properly works.
- Old data causing `?blocked` to fail. ([GH #3131](https://github.com/kyb3r/modmail/issues/3131))

### Internal

Expand Down
1 change: 0 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import logging
import os
import re
import signal
import string
import struct
import sys
Expand Down
4 changes: 3 additions & 1 deletion cogs/modmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,9 @@ async def blocked(self, ctx):
)

if end_time is not None:
after = (datetime.fromisoformat(end_time.group(1)) - now).total_seconds()
after = (
datetime.fromisoformat(end_time.group(1)).replace(tzinfo=timezone.utc) - now
).total_seconds()
if after <= 0:
# No longer blocked
self.bot.blocked_users.pop(str(id_))
Expand Down

0 comments on commit f03e203

Please sign in to comment.