Advertisement
JustHassan

Untitled

Feb 13th, 2021
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.46 KB | None | 0 0
  1. const Discord = require('discord.js');
  2. const fs = require('fs');
  3. const client = require('../index')
  4. const db = client.db
  5.  
  6. module.exports = {
  7. name: "profile",
  8. cooldown: 10,
  9. async execute(msg, args, client) {
  10.  
  11. var args = msg.content.split(' ').slice(1);
  12. let user = msg.mentions.users.first() || client.users.cache.get(args[0]) || msg.author;
  13.  
  14.  
  15. //embeds
  16.  
  17. let embedcolor = await db.get(`embedcolor_${msg.guild.id}`);
  18. if(embedcolor == null) embedcolor = "#b256b6";
  19.  
  20. let nouser = new Discord.MessageEmbed()
  21. .setDescription(`<:749753030899007620:749779549574922301> **Couldn't Find User**`)
  22. .setColor(embedcolor);
  23.  
  24. let bots = new Discord.MessageEmbed()
  25. .setDescription(`<:749753030899007620:749779549574922301> **Bots Doesn't Have Profiles**`)
  26. .setColor(embedcolor);
  27.  
  28. //END EMBEDS
  29. if(!user) return msg.channel.send(nouser)
  30.  
  31. if(user.bot) return msg.channel.send(bots)
  32.  
  33. let curbg = await db.fetch(`currentbg_${user.id}`)
  34. if(curbg == null) curbg = 'https://cdn.discordapp.com/attachments/741429412083269753/741429831324926009/8d542db2bf43fd638bfa96006248b7fd.jpg';
  35.  
  36. let coins = await db.fetch(`coins_${user.id}`)
  37. if(coins == null) coins = '0'
  38.  
  39. let likes = await db.fetch(`likes_${user.id}`)
  40. if(likes == null) likes = '0'
  41. let note = await db.fetch(`note_${user.id}`);
  42. if(note == null) note = ''
  43.  
  44. let uBlacklist = await db.fetch(`Blacklist_${user.id}`);
  45. if(uBlacklist === 'on') coins = 'Blacklisted' , likes = 'Blacklisted' , note = 'Blacklisted'
  46.  
  47.  
  48.  
  49. const devs = ["708079263387090974","700656817344086078","605509682294947864","710671121871011891","547843804657352704","391356330654564352","560597939563790347","742863518218321994","633775422554767370"];
  50.  
  51. const vip = ["723911619251404801","","",""];
  52.  
  53.  
  54.  
  55.  
  56. const liver = await db.fetch(`liver_${user.id}`);
  57. const real = await db.fetch(`real_${user.id}`);
  58. const bvb = await db.fetch(`bvb_${user.id}`);
  59. const barca = await db.fetch(`barca_${user.id}`);
  60. let cur = await db.fetch(`curbadge_${user.id}`)
  61.  
  62.  
  63. const Canvas = require('canvas')
  64. const { loadImage } = require('canvas')
  65.  
  66. const canvas = Canvas.createCanvas(400, 400);
  67. const ctx = canvas.getContext('2d');
  68. canvas.width = 400;
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75. const x = canvas.width / 2;
  76.  
  77.  
  78.  
  79.  
  80.  
  81. const back = await loadImage(curbg)
  82. ctx.drawImage(back, 0, 0, 400, 400);
  83.  
  84.  
  85. const template = await loadImage('https://cdn.discordapp.com/attachments/749777003510759505/750223492716298260/sfdsdsdsd.png')
  86. ctx.drawImage(template, 0, 0, 400, 400);
  87.  
  88.  
  89. ctx.font = "bold 30px kathen"; //Name ,_,
  90. ctx.fontSize = "40px";
  91. ctx.fillStyle = "#000000";
  92. ctx.textAlign = "center";
  93. ctx.fillText(`${user.username} `, x, 202);
  94.  
  95. ctx.font = "bold 30px kathen"; //Name ,_,
  96. ctx.fontSize = "40px";
  97. ctx.fillStyle = "#f1f1f1";
  98. ctx.textAlign = "center";
  99. ctx.fillText(`${user.username} `, x, 200);
  100.  
  101.  
  102. ctx.font = "bold 22px kathen"; //Name ,_,
  103. ctx.fontSize = "22px";
  104. ctx.fillStyle = "#000000";
  105. ctx.textAlign = "center";
  106. ctx.fillText(`${note} `, x, 322.9);
  107.  
  108. ctx.font = "bold 22px kathen"; //Name ,_,
  109. ctx.fontSize = "22px";
  110. ctx.fillStyle = "#f1f1f1";
  111. ctx.textAlign = "center";
  112. ctx.fillText(`${note} `, x, 320.9);
  113.  
  114. ctx.font = "bold 20px kathen"; //Name ,_,
  115. ctx.fontSize = "20px";
  116. ctx.fillStyle = "#000000";
  117. ctx.fillText(`${coins} `, 92.6, 138.3);
  118.  
  119. ctx.font = "bold 20px kathen"; //Name ,_,
  120. ctx.fontSize = "20px";
  121. ctx.fillStyle = "#f1f1f1";
  122. ctx.fillText(`${coins} `, 92.6, 136.3);
  123.  
  124. ctx.font = "bold 20px kathen"; //Name ,_,
  125. ctx.fontSize = "20px";
  126. ctx.fillStyle = "#000000";
  127. ctx.fillText(`${likes} `, 314.6, 138.3);
  128.  
  129.  
  130. ctx.font = "bold 20px kathen"; //Name ,_,
  131. ctx.fontSize = "20px";
  132. ctx.fillStyle = "#f1f1f1";
  133. ctx.fillText(`${likes} `, 314.6, 136.3);
  134.  
  135.  
  136.  
  137. if (devs.includes(user.id)) {
  138.  
  139. const devs = await Canvas.loadImage('https://cdn.discordapp.com/attachments/740429389832912896/741427091337248888/e63co024yh741.png');
  140. ctx.drawImage(devs, 179, 226, 42, 42);
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150. }
  151.  
  152. if (vip.includes(user.id)) {
  153.  
  154. const vip2 = await Canvas.loadImage('https://cdn.discordapp.com/attachments/740429389832912896/741426265722191872/hypesquad.png');
  155. ctx.drawImage(vip2, 179, 226, 42, 42);
  156. }
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163. if(cur == 'https://cdn.discordapp.com/attachments/740556620358221906/741203011287646218/real-madrid.png') {
  164. if(devs.includes(user.id)) {
  165. const real = await Canvas.loadImage('https://cdn.discordapp.com/attachments/740556620358221906/741203011287646218/real-madrid.png');
  166. ctx.drawImage(real, 248, 226, 50, 50);
  167. } else {
  168. if(vip.includes(user.id)) {
  169. const real = await Canvas.loadImage('https://cdn.discordapp.com/attachments/740556620358221906/741203011287646218/real-madrid.png');
  170. ctx.drawImage(real, 248, 226, 50, 50);
  171. } else {
  172. const real = await Canvas.loadImage('https://cdn.discordapp.com/attachments/740556620358221906/741203011287646218/real-madrid.png');
  173. ctx.drawImage(real, 173, 226, 50, 50);
  174. }
  175. }
  176. }
  177.  
  178.  
  179.  
  180. //Liver
  181. if(cur == 'https://cdn.discordapp.com/attachments/740556620358221906/741203010046132224/liverpool.png') {
  182. if(devs.includes(user.id)) {
  183. const real = await Canvas.loadImage('https://cdn.discordapp.com/attachments/740556620358221906/741203010046132224/liverpool.png');
  184. ctx.drawImage(real, 256, 226, 50, 50);
  185. } else {
  186. if(vip.includes(user.id)) {
  187. const real = await Canvas.loadImage('https://cdn.discordapp.com/attachments/740556620358221906/741203010046132224/liverpool.png');
  188. ctx.drawImage(real, 248, 226, 50, 50);
  189. } else {
  190. const real = await Canvas.loadImage('https://cdn.discordapp.com/attachments/740556620358221906/741203010046132224/liverpool.png');
  191. ctx.drawImage(real, 173, 226, 50, 50);
  192. }
  193. }
  194. }
  195.  
  196. //BARCA
  197. if(cur == 'https://cdn.discordapp.com/attachments/740556620358221906/741203007877939210/022-barcelona.png') {
  198. if(devs.includes(user.id)) {
  199. const real = await Canvas.loadImage('https://cdn.discordapp.com/attachments/740556620358221906/741203007877939210/022-barcelona.png');
  200. ctx.drawImage(real, 248, 226, 50, 50);
  201. } else {
  202. if(vip.includes(user.id)) {
  203. const real = await Canvas.loadImage('https://cdn.discordapp.com/attachments/740556620358221906/741203007877939210/022-barcelona.png');
  204. ctx.drawImage(real, 248, 226, 50, 50);
  205. } else {
  206. const real = await Canvas.loadImage('https://cdn.discordapp.com/attachments/740556620358221906/741203007877939210/022-barcelona.png');
  207. ctx.drawImage(real, 173, 226, 50, 50);
  208. }
  209. }
  210. }
  211.  
  212.  
  213. //BVB
  214.  
  215. if(cur == 'https://cdn.discordapp.com/attachments/740556620358221906/741203008796360714/025-borusia-dortmund.png') {
  216. if(devs.includes(user.id)) {
  217. const real = await Canvas.loadImage('https://cdn.discordapp.com/attachments/740556620358221906/741203008796360714/025-borusia-dortmund.png');
  218. ctx.drawImage(real, 248, 226, 50, 50);
  219. } else {
  220. if(vip.includes(user.id)) {
  221. const real = await Canvas.loadImage('https://cdn.discordapp.com/attachments/740556620358221906/741203008796360714/025-borusia-dortmund.png');
  222. ctx.drawImage(real, 248, 226, 50, 50);
  223. } else {
  224. const real = await Canvas.loadImage('https://cdn.discordapp.com/attachments/740556620358221906/741203008796360714/025-borusia-dortmund.png');
  225. ctx.drawImage(real, 173, 226, 50, 50);
  226. }
  227. }
  228. }
  229.  
  230.  
  231.  
  232. ctx.beginPath();
  233. ctx.arc(199.5, 115.2, 52, -45.9, Math.PI * 2, true);
  234. ctx.closePath();
  235. ctx.clip();
  236.  
  237.  
  238. const avatar = await Canvas.loadImage(user.displayAvatarURL({ format: 'jpg' }));
  239. ctx.drawImage(avatar, 147.7, 63.4, 104, 104);
  240.  
  241.  
  242.  
  243. const attachment = new Discord.MessageAttachment(canvas.toBuffer(), 'profile.png');
  244. msg.channel.startTyping()
  245. msg.channel.send(attachment);
  246. msg.channel.stopTyping()
  247.  
  248.  
  249. //https://i.redd.it/e63co024yh741.png
  250.  
  251.  
  252. //END LOL
  253. }
  254. }
  255.  
  256.  
  257.  
  258.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement