`guildCreate` event doesn't give the discord user ID who added a bot inside guild except super admin

When the guildCreate event is triggered, I am only able to retrieve the ownerId of the guild. However, when a moderator adds the guild, the moderator's ID is not provided. Is there a method available to obtain the Discord user ID of that particular moderator?
client.on('guildCreate', (guild) => {
console.log(guild.ownerId) // returned only owner discord id
});
client.on('guildCreate', (guild) => {
console.log(guild.ownerId) // returned only owner discord id
});
v14.3.0
6 Replies
d.js toolkit
d.js toolkit•3y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
treble/luna
treble/luna•3y ago
do you want to get the id of the person that added the bot?
fahim
fahimOP•3y ago
yes
treble/luna
treble/luna•3y ago
thats not passed in the guildCreate event, you'll have to use auditlogs
fahim
fahimOP•3y ago
Could you please share an example of that?
d.js docs
d.js docs•3y ago
guide Popular Topics: Working with Audit Logs read more

Did you find this page helpful?