Type 2 AutoModeration

---------------------------------------------------------------------
const logChannel = interaction.options.getChannel(`channel`) || null;
---------------------------------------------------------------------
{
type: 2,
metadata: {
durationSeconds: 0,
channel: logChannel,
customMessage: 'This message was prevented.',
},
},
---------------------------------------------------------------------
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.
2 Replies
d.js toolkit
d.js toolkit13mo ago
• 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.
Legends of NGDB™
The AutoModeration rule works fine. Except for this part.