diff options
author | 2021-10-04 20:42:11 +0100 | |
---|---|---|
committer | 2021-10-04 20:42:11 +0100 | |
commit | 44e5f472d3338d4573f69354f8aa49023063d90a (patch) | |
tree | 7f7205e4bbd2c7285aa7ff3d25d668bde2f5d882 | |
parent | Merge pull request #1853 from python-discord/catch-403-from-Typing-calls (diff) |
Use utcnow() and lower a logging level in patch_typing
-rw-r--r-- | bot/monkey_patches.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/monkey_patches.py b/bot/monkey_patches.py index 9c0a22bfb..4dbdb5eab 100644 --- a/bot/monkey_patches.py +++ b/bot/monkey_patches.py @@ -30,20 +30,20 @@ def patch_typing() -> None: Handle those issues by patching the trigger_typing method so it ignores 403's in general. """ - log.info("Patching send_typing, which should fix things breaking when discord disables typing events. Stay safe!") + log.debug("Patching send_typing, which should fix things breaking when discord disables typing events. Stay safe!") original = http.HTTPClient.send_typing last_403 = None async def honeybadger_type(self, channel_id: int) -> None: # noqa: ANN001 nonlocal last_403 - if last_403 and (datetime.now() - last_403) < timedelta(minutes=5): + if last_403 and (datetime.utcnow() - last_403) < timedelta(minutes=5): log.warning("Not sending typing event, we got a 403 less than 5 minutes ago.") return try: await original(self, channel_id) except Forbidden: - last_403 = datetime.now() + last_403 = datetime.utcnow() log.warning("Got a 403 from typing event!") pass |