autoModerationActionExecution Event
Does Sapphire not emit the Discord.js
autoModerationActionExecution
event?
The following code doesn't seem to trigger:
autoModerationActionExecution.ts
I could be doing something completely wrong though!Solution:Jump to solution
Right just looked at Intents in case I was missing anything obvious and apparently
AUTO_MODERATION_EXECUTION
is a completely separate intent https://discord.com/developers/docs/topics/gateway#gateway-intentsDiscord Developer Portal
Discord Developer Portal — API Docs for Bots and Developers
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
6 Replies
Sapphire doesn't re-emit any DiscordJS events. It just binds listeners to the client event emitter. So if DiscordJS emits it, then Sapphire listeners will work for it.
So as long as you meet the requirements for getting the events at all, then Sapphire will work. More than likely if you write
it won't work either.
Regarding requirements, make sure you have the correct permissions for example: https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-autoModerationActionExecution
Discord.js
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
Interesting, the bot should definitely have the permissions. I'll try listening directly on the client. Is the list of events here just for typing then? https://github.com/sapphiredev/framework/blob/c4fb54f/src/lib/types/Events.ts#L26
GitHub
framework/Events.ts at c4fb54f13571d8056adfb8fc9c61769e0a1a20aa · s...
Discord bot framework built on top of discord.js for advanced and amazing bots. - framework/Events.ts at c4fb54f13571d8056adfb8fc9c61769e0a1a20aa · sapphiredev/framework
it is
GitHub
fix(events): add missing discordjs events by favna · Pull Request #...
Apparently, we forgot to update the Events enum to include new (by now quite old) DiscordJS events.
Noticed by: https://discord.com/channels/737141877803057244/1078772436230742108/1078790112118308925
Solution
Right just looked at Intents in case I was missing anything obvious and apparently
AUTO_MODERATION_EXECUTION
is a completely separate intent https://discord.com/developers/docs/topics/gateway#gateway-intentsDiscord Developer Portal
Discord Developer Portal — API Docs for Bots and Developers
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Thanks for the PR btw!