S-IAF
Join ServerSapphire - Imagine a framework
sapphire-support
autoModerationActionExecution Event
FFozzie2/24/2023
Does Sapphire not emit the Discord.js
The following code doesn't seem to trigger:
I could be doing something completely wrong though!
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!");
}
}
I could be doing something completely wrong though!
FFavna2/24/2023
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
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) => {
});
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
FFozzie2/24/2023
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
FFavna2/24/2023
it is
FFavna2/24/2023
Solution
FFozzie2/24/2023
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-intentsFFozzie2/24/2023
Thanks for the PR btw!