Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- client.on('message', message => {
- if (!points[message.author.id]) points[message.author.id] = {
- points: 0,
- };
- if (message.content.startsWith(prefix + 'فكك')) {
- if(!message.channel.guild) return message.reply('**هذا الأمر للسيرفرات فقط**').then(m => m.delete(3000));
- const type = require('./fkk.json');
- const item = type[Math.floor(Math.random() * type.length)];
- const filter = response => {
- return item.answers.some(answer => answer.toLowerCase() === response.content.toLowerCase());
- };
- message.channel.send('**لديك 15 ثانيه لتفكيك الكلمه**').then(msg => {
- msg.channel.send(`${item.type}`).then(() => {
- message.channel.awaitMessages(filter, { maxMatches: 1, time: 15000, errors: ['time'] })
- .then((collected) => {
- message.channel.send(`${collected.first().author} ✅ **احسنت لقد تمكنت من تفكيك الكلمه بسرعه**`);
- console.log(`[Typing] ${collected.first().author} typed the word.`);
- let won = collected.first().author;
- points[won.id].points++;
- })
- .catch(collected => {
- message.channel.send(`:x: **لم يتمكن احد من تفكيك الكلمه في الوقت المناسب**`);
- console.log('[Typing] Error: No one type the word.');
- })
- })
- })
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment