AutoModerationActionExecution event

client.on(Events.AutoModerationActionExecution, async (autoModerationActionExecution) => {
try {
console.log('AutoModerationActionExecution event triggered:');

// Log relevant properties
console.log(`Action ID: ${autoModerationActionExecution.action.id}`);
console.log(`Action Type: ${autoModerationActionExecution.action.type}`);
console.log(`Action Metadata: ${autoModerationActionExecution.action.metadata}`);
console.log(`Execution Status: ${autoModerationActionExecution.status}`);
console.log(`Rule ID: ${autoModerationActionExecution.ruleId}`);
console.log(`Rule Name: ${autoModerationActionExecution.ruleName}`);
console.log(`User ID: ${autoModerationActionExecution.user.id}`);
console.log(`User Tag: ${autoModerationActionExecution.user.tag}`);
console.log(`Channel ID: ${autoModerationActionExecution.channel.id}`);
console.log(`Channel Name: ${autoModerationActionExecution.channel.name}`);
console.log(`Content: ${autoModerationActionExecution.content}`);

// Add custom logic here to handle the auto-moderation action execution
// For example, send a message to a log channel or notify moderators
} catch (error) {
console.error('Error handling AutoModerationActionExecution event:', error);
}
});
client.on(Events.AutoModerationActionExecution, async (autoModerationActionExecution) => {
try {
console.log('AutoModerationActionExecution event triggered:');

// Log relevant properties
console.log(`Action ID: ${autoModerationActionExecution.action.id}`);
console.log(`Action Type: ${autoModerationActionExecution.action.type}`);
console.log(`Action Metadata: ${autoModerationActionExecution.action.metadata}`);
console.log(`Execution Status: ${autoModerationActionExecution.status}`);
console.log(`Rule ID: ${autoModerationActionExecution.ruleId}`);
console.log(`Rule Name: ${autoModerationActionExecution.ruleName}`);
console.log(`User ID: ${autoModerationActionExecution.user.id}`);
console.log(`User Tag: ${autoModerationActionExecution.user.tag}`);
console.log(`Channel ID: ${autoModerationActionExecution.channel.id}`);
console.log(`Channel Name: ${autoModerationActionExecution.channel.name}`);
console.log(`Content: ${autoModerationActionExecution.content}`);

// Add custom logic here to handle the auto-moderation action execution
// For example, send a message to a log channel or notify moderators
} catch (error) {
console.error('Error handling AutoModerationActionExecution event:', error);
}
});
WHY IT AINT DETECTING AUTOMOD ACTIONS?
7 Replies
d.js toolkit
d.js toolkit2mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Mark
Mark2mo ago
Show client constructor and confirm the permissions your bot has in the guild Guild#members#me#permissions#serialize
treble/luna
treble/luna2mo ago
Also make sure you have the required intent
Auth
AuthOP2mo ago
Pastebin
const { token, clientId } = require('./config.json');const fs = req...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Auth
AuthOP2mo ago
oh-
d.js docs
d.js docs2mo ago
:dtypes: v10: GatewayIntentBits - AutoModerationExecution read more
Auth
AuthOP2mo ago
ig the problem is intent or no...
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.GuildModeration,

]
});
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.GuildModeration,

]
});
or yess yess AutoModerationExecution was missing mb ty
Want results from more Discord servers?
Add your server