diff options
| author | 2021-03-25 20:32:07 +0000 | |
|---|---|---|
| committer | 2021-03-25 20:32:07 +0000 | |
| commit | 93b9d410ce03a356b7c5edea87b389faeee36168 (patch) | |
| tree | 549248e8f2ded2098ac4008d9baaea4e740c0ad1 | |
| parent | update help channel on_message docstring to reflect unchanged responsibility (diff) | |
Only fetch claimant id once
| -rw-r--r-- | bot/exts/help_channels/_message.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bot/exts/help_channels/_message.py b/bot/exts/help_channels/_message.py index c20af2946..074fd01da 100644 --- a/bot/exts/help_channels/_message.py +++ b/bot/exts/help_channels/_message.py @@ -52,12 +52,13 @@ async def update_message_caches(message: discord.Message) -> None: # Must use a timezone-aware datetime to ensure a correct POSIX timestamp. timestamp = datetime.now(timezone.utc).timestamp() + claimant_id = await _caches.claimants.get(channel.id) + # Overwrite the claimant message time, if its from the claimant. - if message.author == await _caches.claimants.get(channel.id): + if message.author.id == claimant_id: await _caches.claimant_last_message_times.set(channel.id, timestamp) return - claimant_id = await _caches.claimants.get(channel.id) if not claimant_id: # The mapping for this channel doesn't exist, we can't do anything. return |