Remove post-reaction verification refetch
Was doing an extra fetch_message per reaction to confirm the reaction stuck. Turned out to be unrelated to the earlier missing-reactions bug (that was the scan-state resume issue), so drop it to save the API calls.
This commit is contained in:
@@ -26,7 +26,6 @@ async def react_to_message(
|
||||
emoji: str,
|
||||
source: str,
|
||||
display: Optional[StatsDisplay] = None,
|
||||
verify: bool = True,
|
||||
) -> bool:
|
||||
if message.author.id != friend_id:
|
||||
return False
|
||||
@@ -47,20 +46,6 @@ async def react_to_message(
|
||||
log.exception("Failed to react to message %s in channel %s", message.id, message.channel.id)
|
||||
return False
|
||||
|
||||
if verify:
|
||||
try:
|
||||
refetched = await message.channel.fetch_message(message.id)
|
||||
confirmed = any(r.me and str(r.emoji) == emoji for r in refetched.reactions)
|
||||
except discord.HTTPException:
|
||||
confirmed = None # couldn't verify either way; don't block on it
|
||||
|
||||
if confirmed is False:
|
||||
log.warning(
|
||||
"Reaction API call succeeded but is NOT visible on refetch! "
|
||||
"message=%s channel=%s target=%s (%s) url=%s",
|
||||
message.id, message.channel.id, target.name, target.target_type, message.jump_url,
|
||||
)
|
||||
|
||||
inserted = await asyncio.to_thread(
|
||||
storage.record_reaction,
|
||||
message.id,
|
||||
|
||||
Reference in New Issue
Block a user