discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.39k stars 3.97k forks source link

Typing of AutoModerationActionMetadata incorrect #9110

Closed Larsundso closed 1 year ago

Larsundso commented 1 year ago

Which package is this bug report for?

discord.js

Issue description

Typing says there should be channelId or durationSeconds There actually is channel_id or duration_seconds i.e. parameters not transformed or typing incorrect

  1. Create Automoderation Rule with timeout or alert channel
  2. listen to autoModerationActionExecution event
  3. log <Discord.AutoModerationActionExecution>.action.metadata to console
  4. trigger the auto moderation rule

Code sample

const Discord = require("discord.js");

const client = new Discord.Client({
  shards: "auto",
  intents: [Discord.IntentsBitField.Flags.AutoModerationExecution],
});

client.login(
  "TOKEN"
);

client.on("autoModerationActionExecution", (execution) => {
  console.log(execution.action.metadata);
});

Package version

14.7.1

Node.js version

17.8.0

Operating system

Ubuntu 20.04

Priority this issue should have

Low (slightly annoying)

Which partials do you have configured?

No Partials

Which gateway intents are you subscribing to?

AutoModerationExecution

I have tested this issue on a development release

405f940

Jiralite commented 1 year ago

Do you mind clarifying what's wrong? You haven't exactly said it yourself—just notified that something is wrong.

Larsundso commented 1 year ago

adjusted issue description

Jiralite commented 1 year ago

Thank you!