gae changes

This commit is contained in:
night0721 2022-01-23 02:53:27 +08:00
parent fd0d7c9242
commit 9a87d6c1ea
2 changed files with 1 additions and 151 deletions

149
nsfw.js
View file

@ -1,149 +0,0 @@
const fetch = require("node-fetch");
const {
MessageActionRow,
MessageButton,
MessageEmbed,
CommandInteraction,
} = require("discord.js");
module.exports = {
name: "nsfw",
description: "nsfw command",
/**
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
*/
run: async (client, interaction) => {
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("#02023a");
interaction.followUp({ embeds: [embed] });
return;
}
let subreddits = [
"GoneWild",
"WorkGoneWild",
"GoneWild30Plus",
"hentai",
"HentaiAnime",
"nekogirls",
"ass",
"BestBooties",
"BootyGIFs",
"booty_queens",
"BlowJob",
"blowjobs",
"blowjobgifs",
"OralSex",
"boobs",
"GrabHerTitties",
"titfuck",
"milf",
"OnlyHotMilfs",
"realmoms",
"thighs",
"PerfectThighs",
"thickthighs",
];
let reddit =
subreddits[Math.round(Math.random() * (subreddits.length - 1))];
let embed1 = null;
await fetch(`https://meme-api.herokuapp.com/gimme/${reddit}`).then(res =>
res.json().then(url => {
embed1 = new MessageEmbed()
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setTitle(`${url.title}`)
.setImage(`${url.url}`)
.setTimestamp()
.setColor("RED")
.setFooter(`${url.ups} 👍`);
})
);
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 Meme")
.setStyle("SECONDARY")
.setDisabled(true)
);
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(e => console.log(e.requestData.json.embeds));
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],
});
}
});
}
},
};

View file

@ -11,7 +11,7 @@
"dev": "nodemon .", "dev": "nodemon .",
"start": "node .", "start": "node .",
"lint": "eslint .", "lint": "eslint .",
"node-update": "npm i --save-dev node@16 && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH", "node-update": "npm i --save-dev node@17 && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH",
"node-clean": "rm -rf node_modules && rm package-lock.json && npm cache clear --force && npm cache clean --force && npm i", "node-clean": "rm -rf node_modules && rm package-lock.json && npm cache clear --force && npm cache clean --force && npm i",
"all": "npm run node-update && npm run node-clean" "all": "npm run node-update && npm run node-clean"
}, },
@ -49,7 +49,6 @@
"goosecache": "^9.0.14", "goosecache": "^9.0.14",
"moment": "^2.29.1", "moment": "^2.29.1",
"mongoose": "^5.13.14", "mongoose": "^5.13.14",
"node-fetch": "^3.2.0",
"quickchart-js": "^2.0.3" "quickchart-js": "^2.0.3"
} }
} }