Reputation: 3
In discord.js v12, message.guild.owner
works but in discord.js v13, interaction.guild.owner
does not work. How do I get owner of guild? I don't see interaction.guild.owner
in docs. Anybody can help?
Upvotes: 0
Views: 6160
Reputation: 2286
The docs are always the best place to look for!
You may first get the interaction.guild
for the GuildObject
and further use the .fetchOwner()
method on it, which returns us a promise with when fulfilled returns us the GuildMember
object of the owner.
Upvotes: 1
Reputation: 9041
The Guild.fetchOwner
method fetches the owner from the API and always returns the owner.
//...
let owner = await interaction.guild.fetchOwner()
console.log(owner)
//...
Upvotes: 3