#get_member vs fetch_member

1 messages · Page 1 of 1 (latest)

faint quiver
#

I understand get_member looks for the cached object and the fetch_member does an api request. However if get_member doesn't return anything from the cache does it try and make a request after? or do I have to implement this logic myself?

elfin surgeBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

faint quiver
#

ie


member = client.get_member(id)
if not member:
  member = client.fetch_member(id)
spare slate
spare slate
faint quiver
#

in what case would you want it to maybe get the member

#

lol

alpine crescent
#
  • get_member: obtain the Member from the cache. if not in cache, return None. does not make an API request
  • fetch_member: obtain the Member from the cache. if not in cache, make an API request (ensuring there will be a Member object).
    • if force=True, always make an API request