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 toolkitβ€’2y 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.
Want results from more Discord servers?
Add your server