diff options
author | 2021-10-05 23:31:55 +0200 | |
---|---|---|
committer | 2021-10-05 23:31:55 +0200 | |
commit | 7d7af1378d8110ffa9f8f20953121d3fb889b6d5 (patch) | |
tree | e6d2f703d67e7811a1876ea43be430c3ab9fc367 | |
parent | Merge pull request #1855 from python-discord/antispam-log-improvements (diff) | |
parent | Merge branch 'main' into minor-changes-to-typing-patch (diff) |
Merge pull request #1854 from python-discord/minor-changes-to-typing-patch
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 |