Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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,tite: "HypeLC User", rep: 0, lastDaily: "NOT COLLECTED"};
- let Image = Canvas.Image,
- canvas = new Canvas(300, 300),
- ctx = canvas.getContext('2d');
- fs.readFile("Super.png", 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 = "#000000"; // لون الخط
- ctx.textAlign = "center"; // محاذا ة النص
- ctx.fillText(`${getvalueof.username}`, 153, 173) // احداثيات اسمك
- //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) // احداثيات المصاري
- //poits
- ctx.font = "bold 12px kathen" // ن
- ctx.fontSize = '10px'; // عرض الخطوع الخط وحجمه
- ctx.fillStyle = "#f1f1f1" // لون الخط
- ctx.textAlign = "center"; // محاذا ة النص
- ctx.fillText(`${profile[getvalueof.id].points}`, 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) // احداثيات اللفل
- //info
- ctx.font = "bold 12px kathen" // ن
- ctx.fontSize = '15px'; // عرض الخطوع الخط وحجمه
- ctx.fillStyle = "#000000" // لون الخط
- ctx.textAlign = "center"; // محاذا ة النص
- ctx.fillText(`${profile[getvalueof.id].tite}`, 150, 199) // احداثيات النقاط
- //info
- ctx.font = "bold 12px kathen" // ن
- ctx.fontSize = '15px'; // عرض الخطوع الخط وحجمه
- ctx.fillStyle = "#f1f1f1" // لون الخط
- ctx.textAlign = "center"; // محاذا ة النص
- ctx.fillText(`${profile[getvalueof.id].tite}`, 150, 197) // احداثيات النقاط
- // 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