Advertisement
Guest User

Profile With Info , Tittle , rep... #CoDeS.

a guest
Oct 22nd, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.92 KB | None | 0 0
  1. client.on("message", message => {
  2. if (message.author.bot) return;
  3. if(!message.channel.guild) return;
  4. if (message.content.startsWith(prefix + "profile")) {
  5. let user = message.mentions.users.first();
  6. var men = message.mentions.users.first();
  7. var heg;
  8. if(men) {
  9. heg = men
  10. } else {
  11. heg = message.author
  12. }
  13. var mentionned = message.mentions.members.first();
  14. var h;
  15. if(mentionned) {
  16. h = mentionned
  17. } else {
  18. h = message.member
  19. }
  20. var ment = message.mentions.users.first();
  21. var getvalueof;
  22. if(ment) {
  23. getvalueof = ment;
  24. } else {
  25. getvalueof = message.author;
  26. }
  27. var mentionned = message.mentions.users.first();
  28.  
  29. var client;
  30. if(mentionned){
  31. var client = mentionned;
  32. } else {
  33. var client = message.author;
  34.  
  35. }
  36. if (!profile[getvalueof.id]) profile[getvalueof.id] = {points: 0,reps: "NOT YET",credits: 1, level: 1,tite: "HypeLC User", rep: 0, lastDaily: "NOT COLLECTED"};
  37. let Image = Canvas.Image,
  38. canvas = new Canvas(300, 300),
  39. ctx = canvas.getContext('2d');
  40. fs.readFile("Super.png", function (err, Background) { //امتداد الصورة
  41. if (err) return console.log(err);
  42. let BG = Canvas.Image;
  43. let ground = new Image;
  44. ground.src = Background;
  45. ctx.drawImage(ground, 0, 0, 300, 300); // حجم الصورة
  46.  
  47. })
  48.  
  49.  
  50.  
  51. let url = getvalueof.displayAvatarURL.endsWith(".webp") ? getvalueof.displayAvatarURL.slice(5, -20) + ".png" : getvalueof.displayAvatarURL;
  52. jimp.read(url, (err, ava) => {
  53. if (err) return console.log(err);
  54. ava.getBuffer(jimp.MIME_PNG, (err, buf) => {
  55. if (err) return console.log(err);
  56.  
  57. //ur name
  58. ctx.font = 'bold 16px kathen'; // حجم الخط و نوعه
  59. ctx.fontSize = '40px'; // عرض الخط
  60. ctx.fillStyle = "#000000"; // لون الخط
  61. ctx.textAlign = "center"; // محاذا ة النص
  62. ctx.fillText(`${getvalueof.username}`, 153, 173) // احداثيات اسمك
  63.  
  64. //ur name
  65. ctx.font = 'bold 16px kathen'; // حجم الخط و نوعه
  66. ctx.fontSize = '40px'; // عرض الخط
  67. ctx.fillStyle = "#f1f1f1"; // لون الخط
  68. ctx.textAlign = "center"; // محاذا ة النص
  69. ctx.fillText(`${getvalueof.username}`, 151, 171) // احداثيات اسمك
  70.  
  71. //credit
  72. ctx.font = "bold 12px kathen" // نوع الخط وحجمه
  73. ctx.fontSize = '10px'; // عرض الخط
  74. ctx.fillStyle = "#f1f1f1" // لون الخط
  75. ctx.textAlign = "center"; // محاذا ة النص
  76. ctx.fillText(`$${profile[getvalueof.id].credits}`, 81, 159) // احداثيات المصاري
  77.  
  78. //poits
  79. ctx.font = "bold 12px kathen" // ن
  80. ctx.fontSize = '10px'; // عرض الخطوع الخط وحجمه
  81. ctx.fillStyle = "#f1f1f1" // لون الخط
  82. ctx.textAlign = "center"; // محاذا ة النص
  83. ctx.fillText(`${profile[getvalueof.id].points}`, 221, 159) // احداثيات النقاط
  84.  
  85. //Level
  86. ctx.font = "bold 27px kathen" // نوع الخط و حجمه
  87. ctx.fontSize = '10px'; // عرض الخط
  88. ctx.fillStyle = "#f1f1f1" // لون الخط
  89. ctx.textAlign = "center"; // محاذا ة النص
  90. ctx.fillText(`${profile[getvalueof.id].level}`, 221, 118) // احداثيات اللفل
  91.  
  92. //info
  93. ctx.font = "bold 12px kathen" // ن
  94. ctx.fontSize = '15px'; // عرض الخطوع الخط وحجمه
  95. ctx.fillStyle = "#000000" // لون الخط
  96. ctx.textAlign = "center"; // محاذا ة النص
  97. ctx.fillText(`${profile[getvalueof.id].tite}`, 150, 199) // احداثيات النقاط
  98.  
  99. //info
  100. ctx.font = "bold 12px kathen" // ن
  101. ctx.fontSize = '15px'; // عرض الخطوع الخط وحجمه
  102. ctx.fillStyle = "#f1f1f1" // لون الخط
  103. ctx.textAlign = "center"; // محاذا ة النص
  104. ctx.fillText(`${profile[getvalueof.id].tite}`, 150, 197) // احداثيات النقاط
  105.  
  106. // REP
  107. ctx.font = "bold 26px kathen";
  108. ctx.fontSize = "50px";
  109. ctx.fillStyle = "#f1f1f1";
  110. ctx.textAlign = "center";
  111. ctx.fillText(`+${profile[getvalueof.id].rep}`, 80,117)
  112.  
  113. let Avatar = Canvas.Image;
  114. let ava = new Avatar;
  115.  
  116. ava.src = buf;
  117. ctx.beginPath();
  118. ctx.arc(75, 100, 780, 0, Math.PI*2, true);
  119. ctx.closePath();
  120. ctx.clip();
  121. ctx.drawImage(ava, 116, 82, 72, 72);
  122.  
  123. message.channel.startTyping()
  124. message.channel.sendFile(canvas.toBuffer())
  125. message.channel.stopTyping()
  126. })
  127. })
  128. }
  129. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement