autoModerationActionExecution Event

Does Sapphire not emit the Discord.js autoModerationActionExecution event? The following code doesn't seem to trigger: autoModerationActionExecution.ts
import { Listener } from "@sapphire/framework";
import { AutoModerationActionExecution } from "discord.js";

export class AutoModerationActionExecutionListener extends Listener {

public async run(action: AutoModerationActionExecution) {
console.log("hi!");
}
}
import { Listener } from "@sapphire/framework";
import { AutoModerationActionExecution } from "discord.js";

export class AutoModerationActionExecutionListener extends Listener {

public async run(action: AutoModerationActionExecution) {
console.log("hi!");
}
}
I could be doing something completely wrong though!
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-intents
Discord 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.
Jump to solution
6 Replies
Favna
Favna2y ago
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
client.on('autoModerationActionExecution', (action) => {

});
client.on('autoModerationActionExecution', (action) => {

});
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.
Fozzie
Fozzie2y ago
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
Favna
Favna2y ago
it is
Solution
Fozzie
Fozzie2y ago
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-intents
Discord 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.
Fozzie
Fozzie2y ago
Thanks for the PR btw!
Want results from more Discord servers?
Add your server