Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ErwanGit opened this issue Jul 13, 2024 · 0 comments · Fixed by #10391
Closed

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

ErwanGit opened this issue Jul 13, 2024 · 0 comments · Fixed by #10391

Comments

@ErwanGit
Copy link
Contributor

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

  • discord.js@14.15.2

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

@Jiralite Jiralite self-assigned this Jul 13, 2024
@Jiralite Jiralite changed the title Bad typings for auto-moderation audit-logs Bad typings for auto moderation target type in audit logs Jul 13, 2024
@almeidx almeidx added the has PR label Jul 14, 2024
@kodiakhq kodiakhq bot closed this as completed in #10391 Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants