Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let profile = JSON.parse(fs.readFileSync("./profile.json", "utf8"))
- client.on("message", message => {
- if (message.author.bot) return;
- if(!message.channel.guild)return;
- if (!profile[message.author.id]) profile[message.author.id] = {
- title: 'title',
- rep: 0,
- reps: 'NOT YET',
- lastDaily:'Not Collected',
- level: 0,
- xp: 0,
- credits: 250,
- };
- fs.writeFile('./profile.json', JSON.stringify(profile), (err) => {
- if (err) console.error(err);
- })
- });
- client.on("message", (message) => {
- let men = message.mentions.users.first()
- if (message.author.bot) return;
- if (message.author.id === client.user.id) return;
- if(!message.channel.guild) return;
- if(message.content.startsWith(prefix + "credit" || prefix + "credits")) {
- if(men) {
- if (!profile[men.id]) profile[men.id] = {
- lastDaily:'Not Collected',
- credits: 250,
- };
- }
- if(men) {
- message.channel.send(`** ${men.username}, :credit_card: balance` + " is `" + `$${profile[men.id].credits}` + "`.**")
- } else {
- message.channel.send(`** ${message.author.username}, *Your* :credit_card: balance` + " is `" + `$${profile[message.author.id].credits}` + "`.**")
- }
- }
- if(message.content.startsWith( prefix + "daily")) {
- if(profile[message.author.id].lastDaily != moment().format('day')) {
- profile[message.author.id].lastDaily = moment().format('day')
- profile[message.author.id].credits += 250
- message.channel.send(`:atm: |**${message.author.username} you collect your \`250\` :credit_card: daily credits!**`)
- } else {
- message.channel.send(`**:stopwatch: | ${message.author.username}, your daily :credit_card: credits refreshes ${moment().endOf('day').fromNow()}**`)
- }
- }
- let cont = message.content.slice(prefix.length).split(" ");
- let args = cont.slice(2);
- let sender = message.author
- if(message.content.startsWith( prefix + "trans")) {
- if (!args[0]) {message.channel.send(``);
- return;
- }
- if (isNaN(args[0])) {
- message.channel.send(``);
- return;
- }
- if(profile[message.author.id].credits < args[0]) return message.channel.send(`** :thinking: | ${message.author.username}, Your balance is not enough for that!**`)
- if(args[0].startsWith("-")) return message.channel.send('**!! I Cant Do it**');
- let defineduser = '';
- let firstMentioned = message.mentions.users.first();
- defineduser = (firstMentioned)
- if(defineduser.id === message.author.id) return message.channel.send("***Transfering to your self hah ?!***")
- var mentionned = message.mentions.users.first();
- if (!profile[sender.id]) profile[sender.id] = {}
- if (!profile[sender.id].credits) profile[sender.id].credits = 200;
- fs.writeFile('./profile.json', JSON.stringify(profile), (err) => {
- if (err) console.error(err);
- })
- var x = ['5587' ,' 9978' , '3785' , '7734' , '9864' , '7681' , '3758' , '7834' , '3489' , '1382' , '7389' , '8762' , '0889' , '0388' , '3316' , '0976' , '8603' , '1842' , '4565' , '9524' , '9524' , '0964' , '5930' , '5678' , '9567' , '6099' , '7058' , '0001' , '1324' , '9834' , '7668' , '0378' , '7055' , '9733' , '9876' , '9846' , '9685' , '8574' , '8975' , '9845' , '9862' , '0069' , '0807' , '0673' , '0813' , '1235' , '6879'];
- var x2 = ['5587' ,' 9978' , '3785' , '7734' , '9864' , '7681' , '3758' , '7834' , '3489' , '1382' , '7389' , '8762' , '0889' , '0388' , '3316' , '0976' , '8603' , '1842' , '4565' , '9524' , '9524' , '0964' , '5930' , '5678' , '9567' , '6099' , '7058' , '0001' , '1324' , '9834' , '7668' , '0378' , '7055' , '9733' , '9876' , '9846' , '9685' , '8574' , '8975' , '9845' , '9862' , '0069' , '0807' , '0673' , '0813' , '1235' , '6879'];
- var x3 = Math.floor(Math.random()*x.length)
- message.channel.send(`** | :credit_card: \`${x[x3]}\` type these numbers to confirm**`).then(msg1=> {
- var r = message.channel.awaitMessages(msg => msg.content == x2[x3], { maxMatches : 1, time : 600000, errors : ['time'] })
- r.catch(() => {
- message.delete()
- r.delete()
- msg1.delete()
- r.catch
- })
- r.then(s=> {
- var mando = message.mentions.users.id;
- if (!profile[defineduser.id]) profile[defineduser.id] = {}
- if (!profile[defineduser.id].credits) profile[defineduser.id].credits = 200;
- profile[defineduser.id].credits += (+args[0]);
- profile[sender.id].credits += (-args[0]);
- let mariam = message.author.username
- message.channel.send(`**:credit_card: | ${message.author.username}, has transferrerd ` + "`$" + args[0] + "` to " + `<@${defineduser.id}>**`)
- mentionned.send(`:credit_card: | Transfer Receipt \`\`\`You have received $ ${args[0]} from user ${message.author.username} (ID: ${message.author.id})\`\`\``);
- })
- })
- }
- });
- client.on("message", message => {
- if (!message.content.startsWith(prefix)) return;
- if (message.author.bot) return;
- if (!profile[message.author.id]) profile[message.author.id] = {
- level: 1,
- };
- let userData = profile[message.author.id];
- userData.points++;
- let curLevel = Math.floor(0.1 * Math.sqrt(userData.points));
- if (curLevel > userData.level) {
- // Level up message
- userData.level = curLevel;
- message.channel.send(`**:up: | ${message.author.username} You leveled up to ${curLevel}**`);
- }
- if (message.content.startsWith(prefix + "level")) {
- message.channel.send(`**${message.author.username} You are level is ${userData.level}**`);
- }
- fs.writeFile("./profile.json", JSON.stringify(profile), (err) => {
- if (err) console.error(err)
- });
- });
- client.on('message', message => {
- if(message.content.startsWith(prefix + 'rep')) {
- if(!message.channel.guild) return;
- moment.locale('ar');
- var getvalueof = message.mentions.users.first()
- if(!getvalueof) return message.channel.send(`**:mag: | ${message.author.username}, the user could not be found. **`);
- if(getvalueof.id == message.author.id) return message.channel.send(`**${message.author.username},! you cannot give yourself reputation!**`)
- if(profile[message.author.id].reps != moment().format('L')) {
- profile[message.author.id].reps = moment().format('L');
- profile[getvalueof.id].rep = Math.floor(profile[getvalueof.id].rep+1);
- message.channel.send(`** :up: | ${message.author.username} has given ${getvalueof} a reputation point!**`)
- } else {
- message.channel.send(`**:stopwatch: | ${message.author.username}, \`-Time\` ${moment().endOf('day').fromNow()} **`)
- }
- }
- fs.writeFile('profile.json', JSON.stringify(profile), (err) => {
- if (err) console.error(err);
- })
- });
- client.on('message', message => {
- moment.locale('ar-TN');
- if(!profile[message.author.id]) profile[message.author.id] ={
- points: 0,
- level: 1
- };
- if(message.author.bot) return;
- profile[message.author.id].points = Math.floor(profile[message.author.id].points+1);
- if(profile[message.author.id].points > 120) {
- profile[message.author.id].points = 0
- profile[message.author.id].level = Math.floor(profile[message.author.id].level+1);
- message.channel.send(`**${message.author.username}, <a:Emoji:603642872151146497> لقد وصلت للمستوى __${profile[message.author.id].level}__**`)
- }
- fs.writeFile('profile.json', JSON.stringify(profile), (err) => {
- if (err) console.error(err);
- })
- });
- client.on('message', message => {
- let tit = message.content.split(" ").slice(1).join(" ");
- if(message.content.startsWith(prefix + "title")) {
- if(!profile[message.author.id].tite) profile[message.author.id].tite = "Hey im using Super"
- if(!tit) {
- message.channel.send("**Usage: <title <something>**");
- } else {
- profile[message.author.id].tite = tit
- message.channel.send(`:ok:`)
- }
- }
- fs.writeFile('profile.json', JSON.stringify(profile), (err) => {
- if (err) console.error(err);
- })
- })
- client.on("message", message => {
- if (message.author.bot) return;
- if(!message.channel.guild) return;
- if (message.content.startsWith(prefix + "profile")) {
- let user = message.mentions.users.first();
- var men = message.mentions.users.first();
- var heg;
- if(men) {
- heg = men
- } else {
- heg = message.author
- }
- var mentionned = message.mentions.members.first();
- var h;
- if(mentionned) {
- h = mentionned
- } else {
- h = message.member
- }
- var ment = message.mentions.users.first();
- var getvalueof;
- if(ment) {
- getvalueof = ment;
- } else {
- getvalueof = message.author;
- }
- var mentionned = message.mentions.users.first();
- var client;
- if(mentionned){
- var client = mentionned;
- } else {
- var client = message.author;
- }
- if (!profile[getvalueof.id]) profile[getvalueof.id] = {points: 0,reps: "NOT YET",credits: 1, level: 1,title: "HypeLC User", rep: 0, lastDaily: "NOT COLLECTED"};
- let Image = Canvas.Image,
- canvas = Canvas.createCanvas(300, 300),
- ctx = canvas.getContext('2d');
- fs.readFile("profile.jpg", function (err, Background) { //امتداد الصورة
- if (err) return console.log(err);
- let BG = Canvas.Image;
- let ground = new Image;
- ground.src = Background;
- ctx.drawImage(ground, 0, 0, 300, 300); // حجم الصورة
- })
- let url = getvalueof.displayAvatarURL.endsWith(".webp") ? getvalueof.displayAvatarURL.slice(5, -20) + ".png" : getvalueof.displayAvatarURL;
- jimp.read(url, (err, ava) => {
- if (err) return console.log(err);
- ava.getBuffer(jimp.MIME_PNG, (err, buf) => {
- if (err) return console.log(err);
- //ur name
- ctx.font = 'bold 16px kathen'; // حجم الخط و نوعه
- ctx.fontSize = '40px'; // عرض الخط
- ctx.fillStyle = "#f1f1f1"; // لون الخط
- ctx.textAlign = "center"; // محاذا ة النص
- ctx.fillText(`${getvalueof.username}`, 151, 171) // احداثيات اسمك
- //credit
- ctx.font = "bold 12px kathen" // نوع الخط وحجمه
- ctx.fontSize = '10px'; // عرض الخط
- ctx.fillStyle = "#f1f1f1" // لون الخط
- ctx.textAlign = "center"; // محاذا ة النص
- ctx.fillText(`$${profile[getvalueof.id].credits}`, 81, 159) // احداثيات المصاري
- //xp
- ctx.font = "bold 12px kathen" // ن
- ctx.fontSize = '10px'; // عرض الخطوع الخط وحجمه
- ctx.fillStyle = "#f1f1f1" // لون الخط
- ctx.textAlign = "center"; // محاذا ة النص
- ctx.fillText(`${profile[getvalueof.id].xp}`, 221, 159) // احداثيات النقاط
- //Level
- ctx.font = "bold 27px kathen" // نوع الخط و حجمه
- ctx.fontSize = '10px'; // عرض الخط
- ctx.fillStyle = "#f1f1f1" // لون الخط
- ctx.textAlign = "center"; // محاذا ة النص
- ctx.fillText(`${profile[getvalueof.id].level}`, 221, 118) // احداثيات اللفل
- //Title
- ctx.font = "bold 12px kathen" // ن
- ctx.fontSize = '15px'; // عرض الخطوع الخط وحجمه
- ctx.fillStyle = "#000000" // لون الخط
- ctx.textAlign = "center"; // محاذا ة النص
- ctx.fillText(`${profile[getvalueof.id].title}`, 150, 199) // احداثيات النقاط
- // REP
- ctx.font = "bold 26px kathen";
- ctx.fontSize = "50px";
- ctx.fillStyle = "#f1f1f1";
- ctx.textAlign = "center";
- ctx.fillText(`+${profile[getvalueof.id].rep}`, 80,117) // احداثيات الريب
- let Avatar = Canvas.Image;
- let ava = new Avatar;
- ava.src = buf;
- ctx.beginPath();
- ctx.arc(75, 100, 780, 0, Math.PI*2, true);
- ctx.closePath();
- ctx.clip();
- ctx.drawImage(ava, 116, 82, 72, 72);
- message.channel.startTyping()
- message.channel.sendFile(canvas.toBuffer())
- message.channel.stopTyping()
- })
- })
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement