Rapptz / discord.py

An API wrapper for Discord written in Python.
http://discordpy.rtfd.org/en/latest
MIT License
14.84k stars 3.76k forks source link

ctx.guild.fetch_member() hangs if user has left the server #9299

Closed tlk3 closed 1 year ago

tlk3 commented 1 year ago

Summary

calling fetch_member returns 404, but code hangs

Reproduction Steps

member = await ctx.guild.fetch_member(123456789)

Minimal Reproducible Code

No response

Expected Results

member to be None

Actual Results

Code hangs. Debug log shows:

2023-03-12 01:49:24 DEBUG    discord.http GET https://discord.com/api/v10/guilds/801234481xxxxxxxxxx/members/8048842077xxxxxxxxx with None has returned 404
2023-03-12 01:49:24 DEBUG    discord.http GET /guilds/{guild_id}/members/{member_id} has found its initial rate limit bucket hash (e06f83c33559dfd4dc34f5666fdfa1d3).
2023-03-12 01:49:24 DEBUG    discord.client Dispatching event command_error

Intents

discord.Intents.all()

System Information

Checklist

Additional Context

No response

Rapptz commented 1 year ago

I see no indication of hanging here. It just looks like this was done in the body of a command and an exception was raised.

Expected Results member to be None

No. As documented this raises NotFound for 404 status code.