#Type 2 AutoModeration

2 messages · Page 1 of 1 (latest)

fervent ridge
#
---------------------------------------------------------------------
const logChannel = interaction.options.getChannel(`channel`) || null;
---------------------------------------------------------------------
           {
        type: 2,
        metadata: {
          durationSeconds: 0, 
          channel: logChannel,
          customMessage: 'This message was prevented.',
          },
           },```

So when the user uses the command it should ignore the type 2 action.
But it prompts me with an error saying "Invalid Format".
Anyone know how to make it null?
(I also tried "undefined" too.)
I would set it to required, but I also want to allow the user to not select a channel if they don't want too.
grizzled bluffBOT
#

• 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.