This snippet does not contain any NSFW, it only checks if the channel is NSFW. Use the command !command and then the code will take care of the rest
//There is nothing NSFW about this snippet, it just checks if the channel is or isn't NSFW
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let channel = await lib.discord.channels['@0.3.1'].retrieve({
channel_id: `${context.params.event.channel_id}`,
});
let nsfw = channel.nsfw;
if (nsfw === false) {
await lib.discord.channels['@0.3.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `Whoaaaa, this command can only be used in nsfw channels!`,
});
} else {
await lib.discord.channels['@0.3.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: ``,
embeds: [
{
title: `doggo`,
image: {
url: `https://cdn.discordapp.com/attachments/875477771114147900/956688920224084010/IMG_1174.jpg`,
},
},
],
});
}