}
else if (msg.body == 'list'){
const productsList = new List(
"Here's our list of products at 50% off",
"View all products",
[
{
title: "Products list",
rows: [
{ id: "apple", title: "Apple" },
{ id: "mango", title: "Mango" },
{ id: "banana", title: "Banana" },
],
},
],
"Please select a product"
)
await client.sendMessage(msg.from,productsList)
}
else if (msg.body == 'button'){
let embed = new MessageEmbed()
.sizeEmbed(28)
.setTitle("✅ | Successful process!")
.setDescription("The process has been successful!")
.addField("✔", "To confirm")
.addField("❌", "To cancel")
.addFields({
name: "Now you have 2 buttons to choose!",
value: "✔ or ❌"
}).setFooter("WwebjsSender").setTimestamp()
let button1 = new MessageButton().setCustomId("confirm").setLabel("✔");
let button2 = new MessageButton().setCustomId("cancel").setLabel("❌")
await send({
client: client,
number: msg.from,
embed: embed,
button: [button1, button2]
})
}
else if (msg.body == 'register'){
let someEmbed = new MessageEmbed()
.setTitle(`1️⃣ | What is your name?`)
.setDescription(`Please, type your name.`)
.setFooter(`Question!`)
.setTimestamp()
.sizeEmbed(24);
let anotherEmbed = new MessageEmbed()
.setTitle(`2️⃣ | What is your age?`)
.setDescription(`Please, type your age.`)
.setFooter(`Question!`)
.setTimestamp()
.sizeEmbed(24);
let collect = new Collector({
client: client,
chat: await msg.getChat(),
time: 10000,
number: msg.from,
max: [20, 3],
question: ["🔐 What is your name?", "🚨 What is your age?"],
embed: [someEmbed, anotherEmbed]
})
//@ts-ignore
collect.on("message", async (msg) => {
let body = msg.body;
console.log(body);
});
await collect.initialize();
let resultMessageQuestion = await collect.messageQuestionCollcetor();
let resultEmbedQuestion = await collect.embedQuestionCollector();
console.log(resultMessageQuestion, resultEmbedQuestion);
}