#How to get Username from user_id

1 messages · Page 1 of 1 (latest)

west creek
#

I am trying to migrate a DB, and I have user_ids logged for all users, but i want to add a username field, does anyone know how I could get a discord username from a discord id?

silk muskBOT
#

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

west creek
#

actually, I can do with async, will just be annoying for me

bitter hornet
#

You can use the requests library. And make the request to discord manually

west creek
hollow birch
west creek
#

ohh ok

bitter hornet
#

https://discord.com/api/users/<id>

#

you need a header with
Authorization: Bot <token>

west creek
#

ok

#

ty

west creek
bitter hornet
#

It is dynamic. I can not give you a set limit. I still do recommend you use the library and async.

west creek
#

found another solution, thanks for the info tho