zein69

msg button

Sep 24th, 2023
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const cekbtn = new MessageActionRow()
  2.                 .addComponents(
  3.                     new MessageButton()
  4.                         .setCustomId('mau_down')
  5.                         .setLabel(`Download!`)
  6.                         .setEmoji('⏬')
  7.                         .setStyle('SECONDARY')
  8.                 );
  9.             const msgSend = await msg.reply({
  10.                 content: `https://www.youtube.com/watch?v=` + id,
  11.                 components: [cekbtn]
  12.             });
  13.             const filter = (i) => i.user.id === msg.author.id;
  14.             const collector = msgSend.createMessageComponentCollector({
  15.                 time: 15_000,
  16.                 filter,
  17.             });
  18.             collector.on('collect', async i => {
  19.                 await i.reply({
  20.                     content: 'ok',
  21.                     ephermal: true
  22.                 })
  23.             })
  24.             collector.on('end', async i => {
  25.                 console.log('habis')
  26.             })
Advertisement
Add Comment
Please, Sign In to add comment