#how should i get a user from their username

1 messages · Page 1 of 1 (latest)

stray crypt
#

This is a little complicated, as users can change their username in a guild, or multiple users can share the same username

#

You could use client.users.fetch()

jaunty fable
stray crypt
#

You have multiple valid options to use for fetching

#

Where do you have this username from?

jaunty fable
#

from like

#

somehtine.whois @jaunty fable

#

then parse it

stray crypt
#

Then get the id, and use the id for fetching

jaunty fable
#

how should i get id?

stray crypt
#

Deppends how your bot interacts with this msg

#

Is a classic command? Interaction?

jaunty fable
#

clasic command

#

.whois @jaunty fable

#

like that

stray crypt
#

The id is in the msg content (string)

jaunty fable
#

i have enerthing but getting the user