hikari-py/hikari

User banners not getting cached

Bo0sted opened this issue · 3 comments

Steps to reproduce

  1. Use default cache settings in bot
  2. Run bot
  3. Get a user with a global banner from the bot's cache
  4. Get the banner_url property

Expected result

banner_url works as expected

Actual result

banner_url returns None

System info

hikari (2.0.0.dev108) [6dbab9a6]
located at C:\Users\###\AppData\Local\Programs\Python\Python39\lib\site-packages\hikari
CPython 3.9.5 MSC v.1928 64 bit (AMD64)
Windows ### 10 10.0.19043 AMD64 AMD64 Family 23 Model 1 Stepping 1, AuthenticAMD

Further info

Couple things

When fetching the same user from rest and getting banner_url, it works as expected

I was not able to test whether guilds.member.banner_url is also affected.

Checklist

  • I have made sure to remove ANY sensitive information (bot token, passwords, credentials, personal details, etc.).
  • I have searched the issue tracker and have made sure it's not a duplicate. If it is a follow up of another issue, I have specified it.

This is a Discord limitation and has nothing to do with Hikari. You can also try and see that banner_url isn't cached in discord.js and discord.py either.

As @MakufonSkifto said, this is a Discord limitation, you'll need to fetch the user via REST:
https://www.hikari-py.dev/hikari/api/rest.html#hikari.api.rest.RESTClient.fetch_user

Ah alright. This was not documented anywhere in Hikari's docs so I was not aware of it. Thank you.