· 6 years ago · Sep 07, 2019, 02:20 PM
1// bot.on(`ready`, () => {
2// console.log(`Logged in as ${bot.user.tag}!`);
3// bot.user.setStatus("online")
4// bot.setInterval(() => {
5// for (let i in bot.mutes) {
6// let time = bot.mutes[i].time;
7// let guildID = bot.mutes[i].guildid;
8// let member = bot.mutes[i].muted
9// let roleid = bot.mutes[i].roleid
10// let mutereason = "Mute time is over"
11// if (Date.now() > time) {
12// bot.guilds.get(guildID).members.get(`${member}`).removeRole(roleid, mutereason)
13// delete bot.mutes[i];
14// fs.writeFile("./mutes.json", JSON.stringify(bot.mutes, null, 4), err => {
15// if (err) throw err;
16// })
17// }
18// }
19// }, 5000)
20// });
21// bot.on("guildMemberAdd", async (member) => {
22// for (let i in bot.mutes) {
23// let data = bot.mutes[i];
24// if(data === undefined) return;
25// if(data.guildid !== member.guild.id) return;
26// let mutereason = "ليه تهرب ي بابا امواح م رح أسيبك"
27// let guildID = bot.mutes[i].guildid;
28// if (member.id === bot.mutes[i].muted) {
29// bot.guilds.get(`${guildID}`).members.get(`${member.id}`).addRole(`${bot.mutes[i].roleid}`, mutereason)
30// } else {
31// return;
32// }
33// }
34
35// })
36// bot.on("message", async message => {
37// let prefix = `$` //يمديك تغيره لو تبي
38// let messageArray = message.content.split(" ");
39// let msg = message;
40// let cmd = messageArray[0];
41// let args = messageArray.slice(1);
42// //administration stuff here
43// if (message.content.startsWith(prefix + "mute")) {
44// message.delete();
45// let themuteguy = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
46// if (!themuteguy) return message.channel.send("**الرجاء وضع المنشن**").then(msg => msg.delete(8000))
47// let roleid = message.guild.roles.find(c => c.name === "Muted")
48// if(themuteguy.roles.has(roleid.id)) return message.channel.send("This guy already is muted")
49// let mutereason = args.join(" ").slice(24)
50// if (!mutereason) return message.reply(`\`Usage: ${prefix}mute mention time reason\``)
51// let time = args[1]
52// if (
53// time != "5m"//هنا يمديك تغير الأوقات لو غيرت الي تحت
54// && time != "1d"
55// || !time
56// ) return message.channel.send(`\`The time must be 5m/1h/3h/12h/1d/3d/7d\``) //هنا غير الوقت لو ضفت من الي تحت
57// //هنا يمديك تغير الأوقات او تضيف اوقات
58// time = time.replace("5m", 300)//5 دقائق
59// time = time.replace("1d", 86400)// يوم
60
61// let muteembed = new Discord.RichEmbed()//اللوق
62// .setAuthor("Mute log!")
63// .setColor("#FFFFFF")
64// .setTimestamp()
65// .addField("For:", `${themuteguy} ID: ${themuteguy.id}`)
66// .addField("By:", `${message.author} ID: ${message.author.id}`)
67// .addField("Reason:", mutereason)
68// .addField("Time", `${ms(1000 * time, { long: true })}`)
69// if (!roleid) {
70// try {
71// muterole = await message.guild.createRole({
72// name: "Muted",
73// permissions: []
74// })
75// message.guild.channels.forEach(async (channel) => {
76// await channel.overwritePermissions(muterole, {
77// SEND_MESSAGES: false,
78// ADD_REACTIONS: false
79// });
80// });
81// } catch (e) {
82// console.log(e.stack);
83// }
84// }
85// bot.mutes.count+++1
86// if(isNaN(bot.mutes.count)) bot.mutes.count = 0+1;
87// bot.mutes[bot.mutes.count] = {
88// time: Date.now() + toTime.fromSeconds(time).ms(),
89// muted: themuteguy.id,
90// roleid: roleid.id,
91// guildid: message.guild.id
92// }
93// await message.guild.member(themuteguy.id).addRole(roleid.id, mutereason)
94// fs.writeFile("./mutes.json", JSON.stringify(bot.mutes, null, 4), err => {
95// if (err) throw err;
96// message.reply(`Done <@${themuteguy.id}> Has been muted!`).then(msg => msg.delete(20000))
97// let mutechannel = bot.channels.find(c => c.name === "logs")
98// if (!mutechannel) return;
99// mutechannel.send(muteembed)
100// })
101// }
102// })
103
104bot.on(`ready`, () => {
105 console.log(`Logged in as ${bot.user.tag}!`);
106 bot.user.setStatus("online")
107 bot.setInterval(() => {
108 for (let i in bot.mutes) {
109 let time = bot.mutes[i].time;
110 let guildID = bot.mutes[i].guildid;
111 let member = bot.mutes[i].muted
112 let roleid = bot.mutes[i].roleid
113 let mutereason = "Mute time is over"
114 if (Date.now() > time) {
115 bot.guilds.get(guildID).members.get(`${member}`).removeRole(roleid, mutereason)
116 delete bot.mutes[i];
117 fs.writeFile("./mutes.json", JSON.stringify(bot.mutes, null, 4), err => {
118 if (err) throw err;
119 })
120 }
121 }
122 }, 5000)
123});
124bot.on("guildMemberAdd", async (member) => {
125 for (let i in bot.mutes) {
126 let data = bot.mutes[i];
127 if(data === undefined) return;
128 if(data.guildid !== member.guild.id) return;
129 let mutereason = "ليه تهرب ي بابا امواح م رح أسيبك"
130 let guildID = bot.mutes[i].guildid;
131 if (member.id === bot.mutes[i].muted) {
132 bot.guilds.get(`${guildID}`).members.get(`${member.id}`).addRole(`${bot.mutes[i].roleid}`, mutereason)
133 } else {
134 return;
135 }
136 }
137
138})
139bot.on("message", async message => {
140 let prefix = `$` //يمديك تغيره لو تبي
141 let messageArray = message.content.split(" ");
142 let msg = message;
143 let cmd = messageArray[0];
144 let args = messageArray.slice(1);
145 //administration stuff here
146 if (message.content.startsWith(prefix + "mute")) {
147 message.delete();
148 let themuteguy = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
149 if (!themuteguy) return message.channel.send("**الرجاء وضع المنشن**").then(msg => msg.delete(8000))
150 let roleid = message.guild.roles.find(c => c.name === "Muted")
151 if(themuteguy.roles.has(roleid.id)) return message.channel.send("This guy already is muted")
152 let mutereason = args.join(" ").slice(24)
153 if (!mutereason) return message.reply(`\`Usage: ${prefix}mute mention time reason\``)
154 let time = args[1]
155 if (
156 time != "5m"//هنا يمديك تغير الأوقات لو غيرت الي تحت
157 && time != "1d"
158 || !time
159 ) return message.channel.send(`\`The time must be 5m/1h/3h/12h/1d/3d/7d\``) //هنا غير الوقت لو ضفت من الي تحت
160 //هنا يمديك تغير الأوقات او تضيف اوقات
161 time = time.replace("5m", 60)//5 دقائق
162 time = time.replace("1d", 86400)// يوم
163
164 let muteembed = new Discord.RichEmbed()//اللوق
165 .setAuthor("Mute log!")
166 .setColor("#FFFFFF")
167 .setTimestamp()
168 .addField("For:", `${themuteguy} ID: ${themuteguy.id}`)
169 .addField("By:", `${message.author} ID: ${message.author.id}`)
170 .addField("Reason:", mutereason)
171 .addField("Time", `${ms(1000 * time, { long: true })}`)
172 if (!roleid) {
173 try {
174 muterole = await message.guild.createRole({
175 name: "Muted",
176 permissions: []
177 })
178 message.guild.channels.forEach(async (channel) => {
179 await channel.overwritePermissions(muterole, {
180 SEND_MESSAGES: false,
181 ADD_REACTIONS: false
182 });
183 });
184 } catch (e) {
185 console.log(e.stack);
186 }
187 }
188 bot.mutes.count+++1
189 if(isNaN(bot.mutes.count)) bot.mutes.count = 0+1;
190 bot.mutes[bot.mutes.count] = {
191 time: Date.now() + toTime.fromSeconds(time).ms(),
192 muted: themuteguy.id,
193 roleid: roleid.id,
194 guildid: message.guild.id
195 }
196 await message.guild.member(themuteguy.id).addRole(roleid.id, mutereason)
197 fs.writeFile("./mutes.json", JSON.stringify(bot.mutes, null, 4), err => {
198 if (err) throw err;
199 message.reply(`Done <@${themuteguy.id}> Has been muted!`).then(msg => msg.delete(20000))
200 let mutechannel = bot.channels.find(c => c.name === "logs")
201 if (!mutechannel) return;
202 mutechannel.send(muteembed)
203 })
204 }
205})
206
207
208
209
210
211
212bot.on('message', message =>{
213 let prefix = "$"
214 let messageArray = message.content.split(' ')
215 let cmd = messageArray[0]
216 let args = messageArray.slice(1)
217 if (!message.member.roles.find('name', 'staff')) return ;
218 if(cmd === `${prefix}warn`){
219 message.delete()
220 let mentioned = message.mentions.members.first();
221 if (!mentioned) return message.reply('الرجاء وضع المنشن')
222 if (mentioned.roles.find('name', 'staff')) return message.reply("تخسي");
223 let reason = args.join(' ').slice(22)
224 if (!reason) return message.reply('الرجاء وضع السبب')
225 message.channel.send(args.join(' '))
226 let embed = new Discord.RichEmbed()
227 .setTitle('New Warn!')
228 .addField('For.', mentioned)
229 .addField('By.', message.author)
230 .addField('Reason.', reason)
231 .addField("Channel:", message.channel)
232 .setColor("#54862")
233 let channel = message.guild.channels.find(c => c.name === 'log')
234 if (!channel) return;
235 channel.send(embed)
236 }
237})
238
239
240
241
242//BY: MohmaedTarek - EdiTeD -
243
244// const Discord = require("discord.js");
245// const bot = new Discord.Client({ disableEveryone: false });
246// let client = bot;
247// const ms = require("ms");
248// const fs = require("fs");
249// var request = require("request");
250// const Jimp = require('jimp');
251// const diff = require('color-diff');
252// const getJSON = require('get-json');
253// const download = require('image-downloader');
254// var cheerio = require("cheerio");
255// const talkedRecently = new Set();
256// client.on("ready", function() {
257// client.user.setActivity("MohamedTarek");
258// console.log('شغال')
259// });
260
261// client.on("message", message => {
262// let msg = message;
263// let prefix = `!!`
264// let messageArray = message.content.split(" ");
265// let cmd = messageArray[0].toLowerCase();
266// let args = messageArray.slice(1);
267
268// if (!message.content.startsWith(prefix)) return;
269// if(cmd === `${prefix}blocks`){
270// if (message.author.id === bot.user.id) return;
271// let [player, lol, ...rest] = args;
272// let page = parseInt(lol, 10);
273// if(!player) return message.reply(`**Usage: \`${prefix}blocks <Player Name> [page]\`**`);
274// request(`https://blocksmc.com/player/${player}`, (err,res,html)=>{
275// if(err || res.statusCode != 200) return message.channel.send('There seems to be an error with the API. Try again later. :confounded:');
276// if (!err && res.statusCode == 200){
277// const $ = cheerio.load(html);
278// const userName = $('.profile-header').find('h1').text();
279// if (!userName) return message.channel.send("Player not found")
280// const userTime = $('.gray-cont').find('h1').text().trim();
281// const userRankData = $('.profile-rank');
282// const userRank = userRankData.text().trim();
283// let userHexColor;
284// if(userRank === "Member") userHexColor = "#2b76aa";
285// else if(userRank === "Owner") userHexColor = "#fff000";
286// else if(userRank === "VIP Member") userHexColor = "#ba50e7";
287// else if(userRank === "Moderator") userHexColor = "#e76250";
288// else if(userRank === "Senior Moderator") userHexColor = "#841818";
289// else if(userRank === "Admin") userHexColor = "#841818";
290// else if(userRank === "Head Admin") userHexColor = "#841818";
291// else if(userRank === "Emerald Member") userHexColor = "#00a86b";
292// else if(userRank === "Diamond Member") userHexColor = "#01c5b8";
293// else if(userRank === "Gold Member") userHexColor = "#f3bc00";
294// else if(userRank === "Dev") userHexColor = "#202020";
295// else userHexColor = "#2b76aa";
296// let getData = function(key, value){
297// let text = $(`#${key} #${value}.val`).text();
298// return parseInt(text,10);
299// }
300// const stats = {
301// //BlocksParty
302// BP: {
303// points: getData(`BP`, `Points`),
304// wins: getData(`BP`, `Wins`),
305// played: getData(`BP`, `Played`),
306// image: "https://blocksmc.com/images/pfavatars/BlockParty.png"
307// },
308// //Splegg
309// SP: {
310// points: getData(`SP`, `Points`),
311// eggs: getData(`SP`, `Eggs`),
312// blocks: getData(`SP`, `Blocks`),
313// wins: getData(`SP`, `Wins`),
314// played: getData(`SP`, `Played`),
315// image: "https://blocksmc.com/images/pfavatars/Splegg.png"
316// },
317// //QuakeCraft
318// QC: {
319// points: getData(`QC`, `Points`),
320// kills: getData(`QC`, `Kills`),
321// deaths: getData(`QC`, `Deaths`),
322// fireworks: getData(`QC`, `FireWorks`),
323// wins: getData(`QC`, `Wins`),
324// played: getData(`QC`, `Played`),
325// image: "https://blocksmc.com/images/pfavatars/QuakeCraft.png"
326// },
327// //Gravity
328// GR: {
329// points: getData(`GR`, `Points`),
330// wins: getData(`GR`, `Wins`),
331// played: getData(`GR`, `Played`),
332// image: "https://blocksmc.com/images/pfavatars/Gravity.png"
333// },
334// //SurvivalGames
335// SG: {
336// points: getData(`SG`, `Points`),
337// kills: getData(`SG`, `Kills`),
338// deaths: getData(`SG`, `Deaths`),
339// wins: getData(`SG`, `Wins`),
340// crates: getData(`SG`, `Crates`),
341// played: getData(`SG`, `Played`),
342// image: "https://blocksmc.com/images/pfavatars/SurvivalGames.png"
343// },
344// //LuckyBlockWars
345// LBW: {
346// points: getData(`LBW`, `Points`),
347// kills: getData(`LBW`, `Kills`),
348// deaths: getData(`LBW`, `Deaths`),
349// wins: getData(`LBW`, `Wins`),
350// sponges: getData(`LBW`, `Sponges`),
351// played: getData(`LBW`, `Played`),
352// image: "https://blocksmc.com/images/pfavatars/LuckyBlockWars.png"
353// },
354// //EggWars
355// EW: {
356// points: getData(`EW`, `Points`),
357// kills: getData(`EW`, `Kills`),
358// deaths: getData(`EW`, `Deaths`),
359// wins: getData(`EW`, `Wins`),
360// eggs: getData(`EW`, `Eggs`),
361// played: getData(`EW`, `Played`),
362// image: "https://blocksmc.com/images/pfavatars/EggWars.png"
363// },
364// //EggWars:Solo
365// EWS: {
366// points: getData(`EWS`, `Points`),
367// kills: getData(`EWS`, `Kills`),
368// deaths: getData(`EWS`, `Deaths`),
369// wins: getData(`EWS`, `Wins`),
370// eggs: getData(`EWS`, `Eggs`),
371// played: getData(`EWS`, `Played`),
372// image: "https://blocksmc.com/images/pfavatars/EggWarsSolo.png"
373// },
374// //BedWars
375// BW: {
376// points: getData(`BW`, `Points`),
377// kills: getData(`BW`, `Kills`),
378// deaths: getData(`BW`, `Deaths`),
379// wins: getData(`BW`, `Wins`),
380// beds: getData(`BW`, `Beds`),
381// played: getData(`BW`, `Played`),
382// image: "https://blocksmc.com/images/pfavatars/BedWars.png"
383// },
384// //BedWars:Solo
385// BWS: {
386// points: getData(`BWS`, `Points`),
387// kills: getData(`BWS`, `Kills`),
388// deaths: getData(`BWS`, `Deaths`),
389// wins: getData(`BWS`, `Wins`),
390// beds: getData(`BWS`, `Beds`),
391// played: getData(`BWS`, `Played`),
392// image: "https://blocksmc.com/images/pfavatars/BedWarsSolo.png"
393// },
394// //SkyWars
395// SW: {
396// points: getData(`SW`, `Points`),
397// kills: getData(`SW`, `Kills`),
398// deaths: getData(`SW`, `Deaths`),
399// wins: getData(`SW`, `Wins`),
400// played: getData(`SW`, `Played`),
401// image: "https://blocksmc.com/images/pfavatars/SkyWars.png"
402// },
403// //SkyWars:Solo
404// SWS: {
405// points: getData(`SWS`, `Points`),
406// kills: getData(`SWS`, `Kills`),
407// deaths: getData(`SWS`, `Deaths`),
408// wins: getData(`SWS`, `Wins`),
409// played: getData(`SWS`, `Played`),
410// image: "https://blocksmc.com/images/pfavatars/SkyWarsSolo.png"
411// },
412// //SkyGiant
413// GNT: {
414// points: getData(`GNT`, `Points`),
415// kills: getData(`GNT`, `Kills`),
416// deaths: getData(`GNT`, `Deaths`),
417// wins: getData(`GNT`, `Wins`),
418// played: getData(`GNT`, `Played`),
419// image: "https://blocksmc.com/images/pfavatars/SkyGiant.png"
420// },
421// //SkyGiant Mini
422// GNTM: {
423// points: getData(`GNTM`, `Points`),
424// kills: getData(`GNTM`, `Kills`),
425// deaths: getData(`GNTM`, `Deaths`),
426// wins: getData(`GNTM`, `Wins`),
427// played: getData(`GNTM`, `Played`),
428// image: "https://blocksmc.com/images/pfavatars/SkyGiantMini.png"
429// },
430// //The Bridge
431// TB: {
432// points: getData(`TB`, `Points`),
433// kills: getData(`TB`, `Kills`),
434// deaths: getData(`TB`, `Deaths`),
435// wins: getData(`TB`, `Wins`),
436// goals: getData(`TB`, `Goals`),
437// played: getData(`TB`, `Played`),
438// image: "https://blocksmc.com/images/pfavatars/TheBridge.png"
439// },
440// //1VS1
441// oneVSone: {
442// points: getData(`1VS1`, `Points`),
443// kills: getData(`1VS1`, `Kills`),
444// deaths: getData(`1VS1`, `Deaths`),
445// wins: getData(`1VS1`, `Wins`),
446// rounds: getData(`1VS1`, `Rounds`),
447// played: getData(`1VS1`, `Played`),
448// image: "https://blocksmc.com/images/pfavatars/1VS1.png"
449// },
450// };
451// request.get(`https://api.mojang.com/users/profiles/minecraft/${userName}`, (err, res, body)=>{
452
453// if(!err && res.statusCode === 200){
454// message.channel.startTyping()
455// body = JSON.parse(body);
456// let image = `https://visage.surgeplay.com/full/250/${body.id}.png`;
457// for (const key in stats) {
458// if(`${stats[key].points}` === "NaN"){
459// delete stats[key];
460// };
461// };
462// const embed = new Discord.RichEmbed()
463// .setAuthor(userName, `https://minotar.net/helm/${userName}`, `https://blocksmc.com/player/${userName}`)
464// .addField("**Rank**", `\`${userRank}\``, true)
465// .addField("**Hours**", `\`${userTime}\``, true)
466// .setColor(userHexColor)
467// .setImage(image)
468// .setThumbnail("https://cdn.discordapp.com/icons/211543198651121664/a4baa5a87ff496ef33430c795d5186ff.png")
469// let pages = [embed];
470// if(stats.hasOwnProperty("BP")){
471// const BPEmbed = new Discord.RichEmbed()
472// .addField("**Played:**", `\`${stats.BP.played}\``, true)
473// .addField("**Points:**", `\`${stats.BP.points}\``, true)
474// .addField("**Wins:**", `\`${stats.BP.wins}\``, true)
475// .setImage(stats.BP.image)
476// pages.push(BPEmbed);
477// }
478// if(stats.hasOwnProperty("SP")){
479// const SPEmbed = new Discord.RichEmbed()
480// .addField("**Points:**", `\`${stats.SP.points}\``, true)
481// .addField("**Wins:**", `\`${stats.SP.wins}\``, true)
482// .addField("**Played:**", `\`${stats.SP.played}\``, true)
483// .addField("**Eggs:**", `\`${stats.SP.eggs}\``, true)
484// .addField("**Blocks:**", `\`${stats.SP.blocks}\``, true)
485// .addBlankField(true)
486// .setImage(stats.SP.image)
487// pages.push(SPEmbed);
488// }
489// if(stats.hasOwnProperty("QC")){
490// const QCEmbed = new Discord.RichEmbed()
491// .addField("**Points:**", `\`${stats.QC.points}\``, true)
492// .addField("**Played:**", `\`${stats.QC.played}\``, true)
493// .addField("**Deaths:**", `\`${stats.QC.deaths}\``, true)
494// .addField("**Fireworks:**", `\`${stats.QC.fireworks}\``, true)
495// .addField("**Kills:**", `\`${stats.QC.kills}\``, true)
496// .addField("**Wins:**", `\`${stats.QC.wins}\``, true)
497// .setImage(stats.QC.image)
498// pages.push(QCEmbed);
499// }
500// if(stats.hasOwnProperty("GR")){
501// const GREmbed = new Discord.RichEmbed()
502// .addField("**Points:**", `\`${stats.GR.points}\``, true)
503// .addField("**Played:**", `\`${stats.GR.played}\``, true)
504// .addField("**Wins:**", `\`${stats.GR.wins}\``, true)
505// .setImage(stats.GR.image)
506// pages.push(GREmbed);
507// }
508// if(stats.hasOwnProperty("SG")){
509// const SGEmbed = new Discord.RichEmbed()
510// .addField("**Points:**", `\`${stats.SG.points}\``, true)
511// .addField("**Played:**", `\`${stats.SG.played}\``, true)
512// .addField("**Deaths:**", `\`${stats.SG.deaths}\``, true)
513// .addField("**Crates:**", `\`${stats.SG.crates}\``, true)
514// .addField("**Kills:**", `\`${stats.SG.kills}\``, true)
515// .addField("**Wins:**", `\`${stats.SG.wins}\``, true)
516// .setImage(stats.SG.image)
517// pages.push(SGEmbed);
518// }
519// if(stats.hasOwnProperty("LBW")){
520// const LBWEmbed = new Discord.RichEmbed()
521// .addField("**Points:**", `\`${stats.LBW.points}\``, true)
522// .addField("**Played:**", `\`${stats.LBW.played}\``, true)
523// .addField("**Deaths:**", `\`${stats.LBW.deaths}\``, true)
524// .addField("**Sponges:**", `\`${stats.LBW.sponges}\``, true)
525// .addField("**Kills:**", `\`${stats.LBW.kills}\``, true)
526// .addField("**Wins:**", `\`${stats.LBW.wins}\``, true)
527// .setImage(stats.LBW.image)
528// pages.push(LBWEmbed);
529// }
530// if(stats.hasOwnProperty("EW")){
531// const EWEmbed = new Discord.RichEmbed()
532// .addField("**Points:**", `\`${stats.EW.points}\``, true)
533// .addField("**Played:**", `\`${stats.EW.played}\``, true)
534// .addField("**Deaths:**", `\`${stats.EW.deaths}\``, true)
535// .addField("**Eggs:**", `\`${stats.EW.eggs}\``, true)
536// .addField("**Kills:**", `\`${stats.EW.kills}\``, true)
537// .addField("**Wins:**", `\`${stats.EW.wins}\``, true)
538// .setImage(stats.EW.image)
539// pages.push(EWEmbed);
540// }
541// if(stats.hasOwnProperty("EWS")){
542// const EWSEmbed = new Discord.RichEmbed()
543// .addField("**Points:**", `\`${stats.EWS.points}\``, true)
544// .addField("**Played:**", `\`${stats.EWS.played}\``, true)
545// .addField("**Deaths:**", `\`${stats.EWS.deaths}\``, true)
546// .addField("**Eggs:**", `\`${stats.EWS.eggs}\``, true)
547// .addField("**Kills:**", `\`${stats.EWS.kills}\``, true)
548// .addField("**Wins:**", `\`${stats.EWS.wins}\``, true)
549// .setImage(stats.EWS.image)
550// pages.push(EWSEmbed);
551// }
552// if(stats.hasOwnProperty("BW")){
553// const BWEmbed = new Discord.RichEmbed()
554// .addField("**Points:**", `\`${stats.BW.points}\``, true)
555// .addField("**Played:**", `\`${stats.BW.played}\``, true)
556// .addField("**Deaths:**", `\`${stats.BW.deaths}\``, true)
557// .addField("**Beds:**", `\`${stats.BW.beds}\``, true)
558// .addField("**Kills:**", `\`${stats.BW.kills}\``, true)
559// .addField("**Wins:**", `\`${stats.BW.wins}\``, true)
560// .setImage(stats.BW.image)
561// pages.push(BWEmbed);
562// }
563// if(stats.hasOwnProperty("BWS")){
564// const BWSEmbed = new Discord.RichEmbed()
565// .addField("**Points:**", `\`${stats.BWS.points}\``, true)
566// .addField("**Played:**", `\`${stats.BWS.played}\``, true)
567// .addField("**Deaths:**", `\`${stats.BWS.deaths}\``, true)
568// .addField("**Beds:**", `\`${stats.BWS.beds}\``, true)
569// .addField("**Kills:**", `\`${stats.BWS.kills}\``, true)
570// .addField("**Wins:**", `\`${stats.BWS.wins}\``, true)
571// .setImage(stats.BWS.image)
572// pages.push(BWSEmbed);
573// }
574// if(stats.hasOwnProperty("SW")){
575// const SWEmbed = new Discord.RichEmbed()
576// .addField("**Points:**", `\`${stats.SW.points}\``, true)
577// .addField("**Played:**", `\`${stats.SW.played}\``, true)
578// .addField("**Deaths:**", `\`${stats.SW.deaths}\``, true)
579// .addField("**Kills:**", `\`${stats.SW.kills}\``, true)
580// .addField("**Wins:**", `\`${stats.SW.wins}\``, true)
581// .addBlankField(true)
582// .setImage(stats.SW.image)
583// pages.push(SWEmbed);
584// }
585// if(stats.hasOwnProperty("SWS")){
586// const SWSEmbed = new Discord.RichEmbed()
587// .addField("**Points:**", `\`${stats.SWS.points}\``, true)
588// .addField("**Played:**", `\`${stats.SWS.played}\``, true)
589// .addField("**Deaths:**", `\`${stats.SWS.deaths}\``, true)
590// .addField("**Kills:**", `\`${stats.SWS.kills}\``, true)
591// .addField("**Wins:**", `\`${stats.SWS.wins}\``, true)
592// .addBlankField(true)
593// .setImage(stats.SWS.image)
594// pages.push(SWSEmbed);
595// }
596// if(stats.hasOwnProperty("GNT")){
597// const GNTEmbed = new Discord.RichEmbed()
598// .addField("**Points:**", `\`${stats.GNT.points}\``, true)
599// .addField("**Played:**", `\`${stats.GNT.played}\``, true)
600// .addField("**Deaths:**", `\`${stats.GNT.deaths}\``, true)
601// .addField("**Kills:**", `\`${stats.GNT.kills}\``, true)
602// .addField("**Wins:**", `\`${stats.GNT.wins}\``, true)
603// .addBlankField(true)
604// .setImage(stats.GNT.image)
605// pages.push(GNTEmbed);
606// }
607// if(stats.hasOwnProperty("GNTM")){
608// const GNTMEmbed = new Discord.RichEmbed()
609// .addField("**Points:**", `\`${stats.GNTM.points}\``, true)
610// .addField("**Played:**", `\`${stats.GNTM.played}\``, true)
611// .addField("**Deaths:**", `\`${stats.GNTM.deaths}\``, true)
612// .addField("**Kills:**", `\`${stats.GNTM.kills}\``, true)
613// .addField("**Wins:**", `\`${stats.GNTM.wins}\``, true)
614// .addBlankField(true)
615// .setImage(stats.GNTM.image)
616// pages.push(GNTMEmbed);
617// }
618// if(stats.hasOwnProperty("TB")){
619// const TBEmbed = new Discord.RichEmbed()
620// .addField("**Points:**", `\`${stats.TB.points}\``, true)
621// .addField("**Played:**", `\`${stats.TB.played}\``, true)
622// .addField("**Deaths:**", `\`${stats.TB.deaths}\``, true)
623// .addField("**Goals:**", `\`${stats.TB.goals}\``, true)
624// .addField("**Kills:**", `\`${stats.TB.kills}\``, true)
625// .addField("**Wins:**", `\`${stats.TB.wins}\``, true)
626// .setImage(stats.TB.image)
627// pages.push(TBEmbed);
628// }
629// if(stats.hasOwnProperty("oneVSone")){
630// const oneVSoneEmbed = new Discord.RichEmbed()
631// .addField("**Points:**", `\`${stats.oneVSone.points}\``, true)
632// .addField("**Played:**", `\`${stats.oneVSone.played}\``, true)
633// .addField("**Deaths:**", `\`${stats.oneVSone.deaths}\``, true)
634// .addField("**Rounds:**", `\`${stats.oneVSone.rounds}\``, true)
635// .addField("**Kills:**", `\`${stats.oneVSone.kills}\``, true)
636// .addField("**Wins:**", `\`${stats.oneVSone.wins}\``, true)
637// .setImage(stats.oneVSone.image)
638// pages.push(oneVSoneEmbed);
639// }
640// pages.forEach((e, i)=>{
641// e.fields.forEach((f, fi)=>{
642// if(e.fields.length === fi+1){
643// if(f.value === "\`NaN\`"){
644// pages.splice(i,1);
645// };
646// };
647// });
648// });
649
650// setTimeout(()=>{
651// if(pages.length !== 1){
652// pages.forEach(e=>{
653// e.setColor(userHexColor);
654// e.setFooter(`Page ${page+1} of ${pages.length} | Made by: .MohamedTarek#9258`);
655// if(e.author === embed.author) return;
656// e.setTitle(`${userName}'s Games Stats ? `);
657// });
658// }
659
660// var hhh = 0;
661// var hoho = 0;
662// if (isNaN(page)) {
663// hhh = 1
664// hoho = 0} else if (page > pages.length || page < 0 ) {return message.channel.send('There\'s no such page!')} else {hhh = page
665// hoho = page-1}
666// console.log(hhh)
667// pages[hoho].setFooter(`Page ${hhh} of ${pages.length} looool| Made by: .MohamedTarek#9258`);
668// if (talkedRecently.has(msg.author.id)) {
669// return msg.channel.send("Wait 5 sec before getting typing this again.");
670// } else {
671// talkedRecently.add(msg.author.id);
672// setTimeout(() => {
673// talkedRecently.delete(msg.author.id);
674// }, 5000);
675// }
676// message.channel.send(pages[hoho]).then(embedmsg=>{
677// message.channel.stopTyping(true);
678// if(pages.length === 1) return;
679// embedmsg.react("◀").then(()=>{
680// embedmsg.react("▶").then(()=>{
681// const backwardsFilter = (reaction, user) => reaction.emoji.name === '◀' && user.id === message.author.id;
682// const forwardsFilter = (reaction, user) => reaction.emoji.name === '▶' && user.id === message.author.id;
683// const backwards = embedmsg.createReactionCollector(backwardsFilter, {time: 120000});
684// const forwards = embedmsg.createReactionCollector(forwardsFilter, {time: 120000});
685// backwards.on("collect", r=>{
686// r.remove(message.author);
687// if(hoho === 0) return;
688// hhh--;
689// hoho--;
690// pages[hoho].setFooter(`Page ${hhh} of ${pages.length} | Made by: .MohamedTarek#9258`);
691// embedmsg.edit(pages[hoho]);
692// });
693// forwards.on("collect", r=>{
694// r.remove(message.author);
695// if(hoho+1 === pages.length) return;
696// hhh++;
697// hoho++;
698// pages[hoho].setFooter(`Page ${hhh} of ${pages.length} | Made by: .MohamedTarek#9258`);
699// embedmsg.edit(pages[hoho]);
700// });
701// });
702// });
703// });
704// }, 250);
705// };
706// });
707// }else{
708// return message.channel.send("There might be an error with the API or the name is incorrect")
709// }
710// });
711// };
712// if(cmd === `${prefix}history`){
713// let player = args.slice(0).join(" ");
714// if (!player) return message.channel.send(`**Usage: \`${prefix}history <Player Name>\`**`);
715
716// getJSON(`https://api.mojang.com/users/profiles/minecraft/${player}`, function(error, response){
717// if (error) {
718// return message.channel.send('There seems to be an error with the API. Try again later. :confounded:');
719// } else {
720// var uuid = response.id;
721
722// getJSON(`https://api.mojang.com/user/profiles/${uuid}/names`, function(error, response){
723// var x = 1;
724// var new_arr = response.reverse();
725// const embed = new Discord.RichEmbed()
726// .addField(`${player} past names`, new_arr.map(m => `${x++} \`${m['name']}\``), true);
727// message.channel.send(embed);
728// });
729// }
730// });
731// }
732// if(cmd === `${prefix}about`){
733// let node = client.guilds.get("565898198279913473").emojis.get("611436703869304844");
734// let invite = `https://discordapp.com/oauth2/authorize?&client_id=${client.user.id}&scope=bot&permissions=12659727`;
735// let delta = client.uptime;
736// var days = Math.floor(delta / 86400);
737// delta -= days * 86400;
738// var hours = Math.floor(delta / 3600) % 24;
739// delta -= hours * 3600;
740// var minutes = Math.floor(delta / 60) % 60;
741// delta -= minutes * 60;
742// var total = `${days}:${hours}:${minutes}`;
743// let ping = Date.now() - msg.createdTimestamp;
744// const embed = new Discord.RichEmbed()
745// .setTitle(`:bar_chart: BlocksMC Players Bot`)
746// .setDescription(`**[Support Team](https://discord.gg/p7krJgj)** | **[Invite](${invite})**\n\n${node.toString()} Node.js version: **${Number(process.version.match(/^v(\d+\.\d+)/)[1])}**\n:clock1230: Uptime: **${total}**\n:stopwatch: Average Ping: **${ping} ms**\n:file_cabinet: Total Servers: **${client.guilds.size}**\n:busts_in_silhouette: Total Users: **${client.users.size}**`)
747// .setFooter(`Requested by ${msg.author.username}#${msg.author.discriminator}`, msg.author.avatarURL)
748// .setTimestamp();
749// msg.channel.send(embed);
750// }
751// if(cmd === `${prefix}invite`){
752// let invite = `https://discordapp.com/oauth2/authorize?&client_id=${client.user.id}&scope=bot&permissions=12659727`;
753// msg.author.send(invite);
754// msg.reply("تم ارسال رابط دعوة البوت الى خاصك");
755// }
756// if(cmd === `${prefix}help`){
757// let replies = [
758// "**b$blocks** **-**في هذا الأمر يمكنك من رؤية معلومات واحصائيات اي لاعب في بلوكس",
759// "**b$skin** **-** في هذا الأمر يمكنك من رؤية سكن اي لاعب تكتبه ",
760// "**b$history** **-** في هذا الأمر يمكنك رؤية تاريخ الاسماء لأي لاعب تكتبه",
761// "**b$suggest** **-** في هذا الأمر يمكنك ارسال اقتراح لمبرمجين البوت",
762// "**b$invite** **-** في هذا الأمر يمكنك الحصول على رابط دعوة البوت",
763// "**b$about** **-** في هذا الأمر يمكنك رؤية معلومات واحصائيات عن البوت "
764// ]
765// let replies2 =
766// [
767// "**b$blocks** **-** You can see Info and stats about any player in blocksmc",
768// "**b$skin** **-** You can see the skin of any player you type",
769// "**b$history** **-** You can see the name history of anybody you want",
770// "**b$suggest** **-** You can send your suggestions using this command",
771// "**b$invite** **-** You can get the bot invite using this command",
772// "**b$about** **-** You can learn about the bot and it's stats using this command"
773
774
775// ]
776// var Embed = new Discord.RichEmbed()
777// .setTitle("BlocksMC Community")
778// .setAuthor("BlocksMC", `https://cdn.discordapp.com/emojis/444254912491290624.png?v=1%22`)
779// .addField("__**الأوامر**__", replies)
780// .addField("__**Commands**__", replies2)
781// .setURL(`https://blocksmc.com/`)
782// .setThumbnail("https://cdn.discordapp.com/emojis/444254912491290624.png?v=1%22")
783// .setFooter("Developed By: .MohamedTarek#9258")
784// message.channel.send(Embed)
785// }
786
787
788
789// if(cmd === `${prefix}suggest`) {
790// let suggestionchat = bot.guilds.get("565898198279913473").channels.get("595793620276346880")
791// let suggestion = args.join(' ');
792
793// if(!suggestion) return message.channel.send('الرجاء وضع اقتراحك بعد الأمر');
794// if(!suggestionchat) return message.channel.send('There seems to be an error Please Contact the developers of the bot');
795
796// let suggestionembed = new Discord.RichEmbed()
797// .setAuthor('New Suggestion!', 'https://cdn.discordapp.com/emojis/444254912491290624.png?v=1%22)')
798// .addField('Suggestion By', `${message.author.tag} **|** ${message.author.id}`, true)
799// .addField('Server name', `${message.guild.name} **|** ${message.guild.id}`)
800// .addField('Suggestion', `${suggestion}`)
801// .setColor('#ffffff')
802// .setTimestamp();
803// suggestionchat.send(suggestionembed);
804
805// message.channel.send("Done =) Your suggestion has been sent to the developers")
806// }
807
808// if(cmd === `${prefix}skin`){
809// if (message.author.id === bot.user.id) return;
810
811// let player = args.slice(0).join(" ");
812// if (!player) return message.channel.send('الرجاء وضع اسم اللاعب')
813
814
815// getJSON(`https://api.mojang.com/users/profiles/minecraft/${player}`, function(error, response){
816// if (error) {
817// return message.channel.send('There seems to be an error with the API. Try again later. :confounded:');
818// } else {
819// var uuid = response.id;
820
821// const options = {
822// url: `https://visage.surgeplay.com/full/250/${uuid}.png`,
823// dest: `./${uuid}.png`
824// };
825// download.image(options)
826// .then(({ filename, image }) => {
827// console.log('File saved to', filename);
828// })
829// .catch((err) => {
830// console.error(err);
831// });
832
833// setTimeout(() => {
834// var embed = new Discord.RichEmbed()
835// .setTitle(player)
836// .setColor("#ffffff")
837// .setFooter("Made by: .MohamedTarek#9258")
838// .attachFiles([`${__dirname}/${uuid}.png`])
839// .setImage(`attachment://${uuid}.png`)
840// .setThumbnail(`https://visage.surgeplay.com/head/${uuid}?size=30`)
841// .setURL(`https://namemc.com/profile/${player}`)
842// .addBlankField(true);
843// message.channel.send(embed);
844// }, 2000);
845// }
846// setTimeout(() => {
847// fs.unlink(`./${uuid}.png`, function(error) {
848// if (error) {
849// console.log(error);
850// }
851// });
852// }, 5000);
853// });
854// }else{
855// return;
856// }
857
858// })