Skip to content

Bad typings for auto moderation target type in audit logs #10390

@ErwanGit

Description

@ErwanGit

Which package is this bug report for?

discord.js

Issue description

When we fetch the auto-moderation audit-logs (here AutoModerationUserCommunicationDisabled), the typing of <GuildAuditLogsEntry>.targetType returns "AutoModerationRule" when in fact it is "AutoModeration".

image

Code sample

client.on('messageCreate', async (message) => {
  if (message.guild) {
    const auditLogs = await message.guild.fetchAuditLogs({
      limit: 1,
      type: AuditLogEvent.AutoModerationUserCommunicationDisabled
    });
    const firstAuditLog = auditLogs.entries.first();

    console.log(firstAuditLog?.targetType);
  }
});

Versions

Issue priority

Low (slightly annoying)

Which partials do you have configured?

Not applicable

Which gateway intents are you subscribing to?

Not applicable

I have tested this issue on a development release

be04acd

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions