Type 2 AutoModeration

---------------------------------------------------------------------
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.
Was this page helpful?