Closed develogo closed 4 years ago
You need to fetch the owner:
let owner = await client.users.fetch(value.ownerID)
If you dont want to cache the guild owner, you can add false in the second parameter:
let owner = await client.users.fetch(value.ownerID, false)
Then you can get it from owner.username
Thanks, this worked for me, I just changed to get the name of the owner of each server.
It looked like this:
let owner = await value.owner.fetch(value.ownerID)
Congratulations for the incredible work!
If you're gonna use User#fetch then you dont need to pass any parameter, just await value.owner.fetch()
is enough since it already implies the ID contained in the owner. The first parameter is a boolean value for whether or not to bypass the cache when fetching.
I'm trying to load the information from the server and save it to a database. I'm getting information like name, id, urlImage, owner id ... But I want to get the owner's name, and I'm getting a null result. I know that DiscordLight does not store cache. Would there be any other way of obtaining this information?