Closed TjMatBTW closed 3 years ago
As stated in the docs, banners are only available via bot.fetch_user
.
Will that be changed in the future?
That's likely a discord limitation so no.
Just use fetch_user as a fallback if the user doesnt have a banner the first time.
Just use fetch_user as a fallback if the user doesnt have a banner the first time.
I did that, it's actually the only way to circunvent this issue.
Summary
If the user is offline, the banner retrieval is impossible
Reproduction Steps
I coded a simple banner retrieval code, similar to the avatar command. I made a check to check if the user had actually a banner and it works. However, if the desired user is offline, it will display as user that doesn't have a banner.
Minimal Reproducible Code
Expected Results
I expected it to always send the banner image if the desired user had one, and if the user didn't, it would send
That user does not have a banner
.Actual Results
If the user is offline, it would always display the error
That user does not have a banner
.Intents
Presence & Server Members.
System Information
Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\discord__main.py", line 300, in
main()
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\discord__main.py", line 297, in main
args.func(parser, args)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\discord__main__.py", line 52, in core
show_version()
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\discord__main.py", line 41, in show_version
pkg = pkg_resources.get_distribution('pycord')
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\init__.py", line 466, in get_distribution
dist = get_provider(dist)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\init__.py", line 342, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\ init.py", line 886, in require
needed = self.resolve(parse_requirements(requirements))
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\init__.py", line 772, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pycord' distribution was not found and is required by the application
Checklist
Additional Context
No response