mirror of
https://github.com/SrIzan10/femboybot.git
synced 2026-06-06 00:56:50 +00:00
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { commandModule, CommandType } from '@sern/handler';
|
|
import axios from 'axios';
|
|
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ComponentType } from 'discord.js';
|
|
import { publish } from '../../src/plugins/publish.js';
|
|
|
|
export default commandModule({
|
|
type: CommandType.Both,
|
|
plugins: [publish()],
|
|
description: ':boobas:',
|
|
//alias : [],
|
|
execute: async (ctx, args) => {
|
|
const request = await axios('https://api.waifu.pics/sfw/waifu').then(res => res.data)
|
|
const button = new ActionRowBuilder<ButtonBuilder>()
|
|
.addComponents(
|
|
new ButtonBuilder()
|
|
.setLabel('Envíaselo a todos')
|
|
.setCustomId('waifu-send')
|
|
.setStyle(ButtonStyle.Primary)
|
|
)
|
|
const message = await ctx.reply({content: `${request.url}`, components: [button], ephemeral: true})
|
|
const collector = message.createMessageComponentCollector({max: 1, time: 30000, componentType: ComponentType.Button})
|
|
collector.on('collect', async (i) => {
|
|
await i.deferReply()
|
|
if (i.customId === 'waifu-send') {
|
|
const message = await i.editReply({content: `Pedido por ${ctx.user}\n${request.url}`})
|
|
message.react('<:BOOBAS:1020018391119056896>')
|
|
}
|
|
})
|
|
},
|
|
});
|