mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 13:14:58 +05:00
Ура
This commit is contained in:
parent
0a5720892a
commit
c5343ad76e
2 changed files with 51 additions and 51 deletions
|
@ -34,60 +34,60 @@ class NSFW extends BaseCommand {
|
||||||
async execute(client, interaction) {
|
async execute(client, interaction) {
|
||||||
await interaction.deferReply({ ephemeral: true });
|
await interaction.deferReply({ ephemeral: true });
|
||||||
|
|
||||||
if (!interaction.channel.nsfw || interaction.channel.type === ChannelType.DM) return interaction.replyT("misc:NSFW_COMMAND", null, { ephemeral: true, edit: true });
|
if (interaction.channel.type === ChannelType.DM || interaction.channel.nsfw) {
|
||||||
|
const tags = ["hentai", "ecchi", "lewdanimegirls", "hentaifemdom", "animefeets", "animebooty", "biganimetiddies", "sideoppai", "ahegao"].map(tag =>
|
||||||
const tags = ["hentai", "ecchi", "lewdanimegirls", "hentaifemdom", "animefeets", "animebooty", "biganimetiddies", "sideoppai", "ahegao"].map(tag =>
|
JSON.parse(JSON.stringify({
|
||||||
JSON.parse(JSON.stringify({
|
label: tag,
|
||||||
label: tag,
|
value: tag
|
||||||
value: tag
|
}))
|
||||||
}))
|
|
||||||
);
|
|
||||||
|
|
||||||
const row = new ActionRowBuilder()
|
|
||||||
.addComponents(
|
|
||||||
new SelectMenuBuilder()
|
|
||||||
.setCustomId("nsfw_select")
|
|
||||||
.setPlaceholder(client.translate("common:NOTHING_SELECTED"))
|
|
||||||
.addOptions(tags)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
await interaction.editReply({
|
const row = new ActionRowBuilder()
|
||||||
content: interaction.translate("common:AVAILABLE_OPTIONS"),
|
.addComponents(
|
||||||
ephemeral: true,
|
new SelectMenuBuilder()
|
||||||
components: [row]
|
.setCustomId("nsfw_select")
|
||||||
});
|
.setPlaceholder(client.translate("common:NOTHING_SELECTED"))
|
||||||
|
.addOptions(tags)
|
||||||
|
);
|
||||||
|
|
||||||
const filter = i => i.user.id === interaction.user.id;
|
await interaction.editReply({
|
||||||
const collector = interaction.channel.createMessageComponentCollector({ filter, idle: (2 * 60 * 1000) });
|
content: interaction.translate("common:AVAILABLE_OPTIONS"),
|
||||||
|
ephemeral: true,
|
||||||
collector.on("collect", async i => {
|
components: [row]
|
||||||
if (i.isSelectMenu() && i.customId === "nsfw_select") {
|
|
||||||
i.deferUpdate();
|
|
||||||
|
|
||||||
const tag = i?.values[0];
|
|
||||||
const res = await fetch(`https://meme-api.herokuapp.com/gimme/${tag}`).then(response => response.json());
|
|
||||||
|
|
||||||
const embed = new EmbedBuilder()
|
|
||||||
.setColor(client.config.embed.color)
|
|
||||||
.setFooter({
|
|
||||||
text: client.config.embed.footer
|
|
||||||
})
|
|
||||||
.setTitle(res.title)
|
|
||||||
.setDescription(`${interaction.translate("fun/memes:SUBREDDIT")}: **${res.subreddit}**\n${interaction.translate("common:AUTHOR")}: **${res.author}**\n${interaction.translate("fun/memes:UPS")}: **${res.ups}**`)
|
|
||||||
.setImage(res.url)
|
|
||||||
.setTimestamp();
|
|
||||||
|
|
||||||
await interaction.editReply({
|
|
||||||
embeds: [embed]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
collector.on("end", () => {
|
|
||||||
return interaction.editReply({
|
|
||||||
components: []
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
const filter = i => i.user.id === interaction.user.id;
|
||||||
|
const collector = interaction.channel.createMessageComponentCollector({ filter, idle: (2 * 60 * 1000) });
|
||||||
|
|
||||||
|
collector.on("collect", async i => {
|
||||||
|
if (i.isSelectMenu() && i.customId === "nsfw_select") {
|
||||||
|
i.deferUpdate();
|
||||||
|
|
||||||
|
const tag = i?.values[0];
|
||||||
|
const res = await fetch(`https://meme-api.herokuapp.com/gimme/${tag}`).then(response => response.json());
|
||||||
|
|
||||||
|
const embed = new EmbedBuilder()
|
||||||
|
.setColor(client.config.embed.color)
|
||||||
|
.setFooter({
|
||||||
|
text: client.config.embed.footer
|
||||||
|
})
|
||||||
|
.setTitle(res.title)
|
||||||
|
.setDescription(`${interaction.translate("fun/memes:SUBREDDIT")}: **${res.subreddit}**\n${interaction.translate("common:AUTHOR")}: **${res.author}**\n${interaction.translate("fun/memes:UPS")}: **${res.ups}**`)
|
||||||
|
.setImage(res.url)
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
|
await interaction.editReply({
|
||||||
|
embeds: [embed]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
collector.on("end", () => {
|
||||||
|
return interaction.editReply({
|
||||||
|
components: []
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else return interaction.replyT("misc:NSFW_COMMAND", null, { ephemeral: true, edit: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
index.js
2
index.js
|
@ -4,7 +4,7 @@ const { GatewayIntentBits } = require("discord.js"),
|
||||||
JaBa = require("./base/JaBa");
|
JaBa = require("./base/JaBa");
|
||||||
|
|
||||||
const client = new JaBa({
|
const client = new JaBa({
|
||||||
intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildBans, GatewayIntentBits.GuildEmojisAndStickers, GatewayIntentBits.GuildIntegrations, GatewayIntentBits.GuildInvites, GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.GuildPresences, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMessageReactions, GatewayIntentBits.GuildMessageTyping, GatewayIntentBits.MessageContent ],
|
intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildBans, GatewayIntentBits.GuildEmojisAndStickers, GatewayIntentBits.GuildIntegrations, GatewayIntentBits.GuildInvites, GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.GuildPresences, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMessageReactions, GatewayIntentBits.GuildMessageTyping, GatewayIntentBits.MessageContent, GatewayIntentBits.DirectMessageTyping, GatewayIntentBits.DirectMessages, GatewayIntentBits.DirectMessageReactions ],
|
||||||
allowedMentions: { parse: ["everyone", "roles", "users"] }
|
allowedMentions: { parse: ["everyone", "roles", "users"] }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue