nyx/unused/commands/Misc/nsfw.js

151 lines
3.9 KiB
JavaScript
Raw Permalink Normal View History

2022-01-22 15:17:36 +01:00
const { getreddit } = require("cath");
const { MessageActionRow, MessageButton, MessageEmbed } = require("discord.js");
module.exports = {
name: "nsfw",
2022-02-22 20:36:09 +01:00
description: "NSFW command",
2022-01-22 15:17:36 +01:00
run: async (client, interaction) => {
const msg = await interaction.channel.send({ content: "Getting images" });
async function embed() {
if (!interaction.channel.nsfw) {
const embed = new MessageEmbed()
.setTitle(`AYO Calm Yo Cheeks`)
.setDescription("This command only works in NSFW Channels!")
.setImage(
"https://media.discordapp.net/attachments/851761493815853060/893777701599584266/warning.gif"
)
.setColor(client.color)
2022-02-22 20:34:26 +01:00
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
2022-01-22 15:17:36 +01:00
.setTimestamp();
interaction.followUp({ embeds: [embed] });
}
let subreddits = [
2022-02-22 20:34:26 +01:00
"GodPussy",
"peachlips",
"vagina",
2022-01-22 15:17:36 +01:00
"GoneWild",
"WorkGoneWild",
"GoneWild30Plus",
"hentai",
"HentaiAnime",
"nekogirls",
"ass",
"BestBooties",
"BootyGIFs",
"booty_queens",
"BlowJob",
"blowjobs",
"blowjobgifs",
"OralSex",
"boobs",
"GrabHerTitties",
"titfuck",
"milf",
"OnlyHotMilfs",
"realmoms",
"thighs",
"PerfectThighs",
"thickthighs",
2022-02-22 20:34:26 +01:00
"PushHerHead",
"ThroatFuck",
2022-01-22 15:17:36 +01:00
];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
2022-02-22 20:34:26 +01:00
let data = await getreddit(reddit);
while (data.length === 0) {
while (data.image.length === 0) {
data = await getreddit(reddit);
}
}
2022-01-22 15:17:36 +01:00
let embed1 = null;
embed1 = new MessageEmbed({
title: data.title,
url: data.url,
image: { url: data.image },
timestamp: Date.now(),
footer: { text: data.footer },
color: client.color,
author: {
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
},
});
return embed1;
}
const row = new MessageActionRow().addComponents(
new MessageButton()
.setCustomId("reload")
.setLabel("Reload")
.setStyle("SUCCESS")
);
const disabled = new MessageActionRow().addComponents(
new MessageButton()
.setCustomId("reload")
.setLabel("Reload")
.setStyle("SECONDARY")
.setDisabled(true)
);
await msg.delete();
let m = await interaction.followUp({
embeds: [await embed()],
components: [row],
});
const collector = m.createMessageComponentCollector({
componentType: "BUTTON",
time: 120000,
});
collector.on("collect", async i => {
if (i.user.id === interaction.user.id) {
i.deferUpdate();
await update(m);
collector.stop();
} else {
i.reply({
content: `These buttons aren't for you!`,
ephemeral: true,
});
}
});
collector.on("end", (mes, r) => {
if (r == "time") {
m.edit({
components: [disabled],
});
}
});
async function update(m) {
m.edit({
embeds: [await embed()],
}).catch(null);
const collector = m.createMessageComponentCollector({
componentType: "BUTTON",
time: 120000,
});
collector.on("collect", async i => {
if (i.user.id === interaction.user.id) {
i.deferUpdate();
await update(m);
collector.stop();
} else {
i.reply({
content: `These buttons aren't for you!`,
ephemeral: true,
});
}
});
collector.on("end", (mes, r) => {
if (r == "time") {
m.edit({
components: [disabled],
});
}
});
}
},
};