Skip to content Skip to sidebar Skip to footer

How To Get The Creator Of A Channel On Event Channelcreate In Discord.js

Would it be possible to find the creator of a channel when the channelCreate event triggers? I've tried looking at the documentation of channels & channelCreate and to log the

Solution 1:

You can try listening to the channelCreate event and then fetch the GuildAuditLogs with Guild.fetchAuditLogs(). Then you can look for the most recent AuditLogEntry who's AuditLogAction is CHANNEL_CREATE. From that you can get the .executor to see who triggered the event

Solution 2:

If you try to get the channelCreator of an command, ex:

!channelcreate

you just need to get the author of the message.

else idk

Post a Comment for "How To Get The Creator Of A Channel On Event Channelcreate In Discord.js"