Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const cool = [];
- client.on('message',async message => {
- if(message.author.bot) return;
- if(message.channel.type === 'dm') return;
- const args = message.content.split(' ');
- const credits = require('./credits.json');
- const path = './credits.json';
- const mention = message.mentions.users.first() || client.users.get(args[1]) || message.author;
- const mentionn = message.mentions.users.first() || client.users.get(args[1]);
- const author = message.author.id;
- const balance = args[2];
- const daily = Math.floor(Math.random() * 350) + 10;
- if(!credits[author]) credits[author] = {credits: 50};
- if(!credits[mention.id]) credits[mention.id] = {credits: 50};
- fs.writeFile(path, JSON.stringify(credits, null, 5), function(err) {if(err) console.log(err)});
- if(message.content.startsWith(prefix + "credit")) {
- if(args[0] !== `${prefix}credit` && args[0] !== `${prefix}credits`) return;
- if(args[2]) {
- if(isNaN(args[2])) return message.channel.send('**:heavy_multiplication_x:| هذه الخانة يجب ان تتكون من ارقام وليس احرف.**');
- if(mention.bot) return message.channel.send(`**:heavy_multiplication_x:| ${message.content.split(' ')[1]} لم يتم العثور على**`);
- if(mention.id === message.author.id) return message.channel.send('**You Cannot trans credit to yourself :x: | :x: لا يمكنك تحويل كردت لنفسك**');
- if(credits[author].credits < balance) return message.channel.send('** :thinking: | ${message.author.username} Your balance is not enough for that!**');
- var one = Math.floor(Math.random() * 9) + 1;
- var two = Math.floor(Math.random() * 9) + 1;
- var three = Math.floor(Math.random() * 9) + 1;
- var four = Math.floor(Math.random() * 9) + 1;
- var number = `${one}${two}${three}${four}`;
- message.channel.send(`**:heavy_dollar_sign:| \`${number}\`, أكتب الرقم للأستمرار**`).then(m => {
- message.channel.awaitMessages(m => m.author.id === message.author.id, {max: 1, time: 10000}).then(c => {
- if(c.first().content === number) {
- m.delete();
- message.channel.send(`**:moneybag: | ${message.author.username}, has transferred \`${balance}\` to ${mention}**`);
- credits[author].credits += (-balance);
- credits[mention.id].credits += (+balance);
- fs.writeFile(path, JSON.stringify(credits, null, 5), function(err) {if(err) console.log(err)});
- } else if(c.first().content !== number) {
- m.delete();
- message.channel.send(`**The Trans has been canceled :x: | :x: تم الغاء الإرسال***`);
- }
- });
- });
- }
- if(!args[2]) {///:credit_card: balance` + " is `" + `${credits[mention.id].credits}$` + "`.
- let defineduser = '';
- if(mention.bot) return message.channel.send(`**:heavy_multiplication_x:| ${message.content.split(' ')[1]} لم يتم العثور على**`);
- message.channel.send(`**${mention.username}, your :credit_card: balance` + " is `" + `$${credits[mention.id].credits}` + "`.**");
- defineduser.send(`**:moneybag: | ${message.author.username} has transfered \`${args[1]}$\` to you **`);
- }
- }
- if(message.content.startsWith(prefix + "daily")) {
- if(cool.includes(message.author.id)) return message.channel.send(`**:stopwatch: : Please cool down 1Day ...**`);
- if(mentionn) {
- var one = Math.floor(Math.random() * 9) + 1;
- var two = Math.floor(Math.random() * 9) + 1;
- var three = Math.floor(Math.random() * 9) + 1;
- var four = Math.floor(Math.random() * 9) + 1;
- var number = `${one}${two}${three}${four}`;
- message.channel.send(`** You Need To write THis number to trans !, \`${number}\` | \`${number}\`, قم بكتابة الرقم للأستمرار**`).then(async m => {
- message.channel.awaitMessages(msg => msg.author.id === message.author.id, {max: 1, time: 20000, errors: ['time']}).then(collected => {
- if(collected.first().content === number) {
- m.delete();
- collected.first().delete();
- credits[mentionn.id].credits += (+daily);
- fs.writeFile(path, JSON.stringify(credits, null, 5), function(err) {if(err) console.log(err)});
- message.channel.send(`**:atm: | ${message.author.username}, you received your :yen: \`${daily}\` daily credits!**`);
- }
- if(collected.first().content !== number) {
- return m.delete();
- }
- });
- });
- } else if(!mentionn) {
- credits[author].credits += (+daily);
- fs.writeFile(path, JSON.stringify(credits, null, 5), function(err) {if(err) console.log(err)});
- message.channel.send(`**:atm: | ${message.author.username}, you received your :yen: ${daily} daily credits!**`);
- }
- cool.unshift(message.author.id);
- setTimeout(() => {
- cool.shift(message.author.id);
- message.author.send("**:atm: | \`Daily\`, يمكنك الحصول على الكردت المجانية الان**").catch();
- }, ms("1d"));
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment