DM a guild owner if the Bot does not have the correct perms when it joins a guild on guildCreate
return guild.ownerId.send({ embeds: [createError ]});
this doesn't work. I am not sure why13 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
of course it doesnt work, a string doesn't have a send method
Guild#fetchOwner()
Fetches the owner of the guild. If the member object isn't needed, use Guild#ownerId instead.
return guild.fetchOwner().send({ embeds: [createError ]});
so is this better?
or do i need to do fetchOwner().id
You need to resolve the promise
fetchOwner()
returns a Promiseso fetchOwner(id)?
Tag suggestion for @padventures:
Resources to understand Promise:
• MDN: learn more
• Guide: learn more
• JavaScript info: learn more
would this work?
if u deconstructed fetchOwner yup
deconstructed?
Destructuring assignment
The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables.
ok
well it does work
ill look at deconstructing things then
oh
i get it
thanks everyone 🙂