Automod api

Hi is there integration for the automod api already or will there be?
8 Replies
d.js toolkit
d.js toolkit14mo ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
DUCKODAS
DUCKODAS14mo ago
it is possible to use the automod system in discord.js
d.js docs
d.js docs14mo ago
class AutoModerationRuleManager (extends CachedManager) Manages API methods for auto moderation rules and stores their cache.
apzrn
apzrn14mo ago
Is there an event for when an automod rule is triggered?
d.js docs
d.js docs14mo ago
event (event) Client#autoModerationActionExecution Emitted whenever an auto moderation rule is triggered. (more...)
apzrn
apzrn14mo ago
Which would that be? Ohhh thanks, is there a way to check if a server has any auto mod rules configured?
d.js docs
d.js docs14mo ago
method AutoModerationRuleManager#fetch() Fetches auto moderation rules from Discord.
apzrn
apzrn14mo ago
const embed = new Discord.EmbedBuilder()
.setTitle('**Auto Mod Guilds:**')
.setColor('#2E3192')
.setDescription(`${await bot.guilds.cache.map((guild) => guild.autoModerationRules.fetch({ cache: false }).enabled === 'true').size}`)
const embed = new Discord.EmbedBuilder()
.setTitle('**Auto Mod Guilds:**')
.setColor('#2E3192')
.setDescription(`${await bot.guilds.cache.map((guild) => guild.autoModerationRules.fetch({ cache: false }).enabled === 'true').size}`)
any idea why its coming back undefined? im trying to check how many guilds have it enabled How do i check if the guild has block words enabled?