Advertisement
gaber-elsayed

profile code by gaber & steve

Oct 1st, 2021
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1.  
  2.  
  3. const Discord = require('discord.js');
  4. const Client = new Discord.Client();
  5.  
  6. Client.login ('NTY5OTE4ODEwMjAzNjE5MzU3.XopQlQ.ya8juZN8-MxbT_onXJa22uHs-hM');
  7. var key = "o3ZCZ8oTbDggWIy";
  8. var stev = '516307527806484490';
  9. Client.on ('ready', async () => {
  10. console.log ("hi");
  11. Client.user.setActivity ('hi', {type: 'WATCHING'})
  12. console.log (Client.user.presence.status)
  13.  
  14. });
  15.  
  16. var Canvas = require ('canvas');
  17. Client.on ('message', async (Message) => {
  18. if (!Message.guild) return null;
  19. if (Message.content.split (' ') [0].toLowerCase() == "$profile") {
  20. var user = Message.mentions.users.first() || Message.author;
  21. const canvas = Canvas.createCanvas(600, 426);
  22. const ctx = canvas.getContext('2d');
  23.  
  24. const background = await Canvas.loadImage('https://cdn.glitch.com/c0c10cad-cebf-44d8-96ba-f5d25bb6e7fd%2Fakon_profile.png?v=1586123895011');
  25.  
  26. ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
  27. const statuss = ['https://media.discordapp.net/attachments/552603311770173470/696495423069618196/9852_Online_Status.png',
  28. 'https://media.discordapp.net/attachments/552603311770173470/696495561418735686/9487_Offline_Status.png',
  29. 'https://media.discordapp.net/attachments/552603311770173470/696495539054968902/9693_Idle_Status.png',
  30. 'https://media.discordapp.net/attachments/552603311770173470/696495508591738980/6290_DND_Status.png'];
  31. const statusn = ['online', 'offline', 'idle', 'dnd'];
  32. var statusImage = await Canvas.loadImage (statuss [statusn.indexOf (user.presence.status.toLowerCase())]);
  33. ctx.drawImage(statusImage, 95, 88, 25, 25);
  34. //instagram
  35. ctx.font = '18px sans-serif';
  36. ctx.fillStyle = '#ffffff';
  37. ctx.fillText ('Instagram', 75, 320);
  38. //Snapchat
  39. ctx.font = '18px sans-serif';
  40. ctx.fillStyle = '#ffffff';
  41. ctx.fillText ('Snapchat', 360, 320);
  42. //twitter
  43. ctx.font = '18px sans-serif';
  44. ctx.fillStyle = '#ffffff';
  45. ctx.fillText ('Twitter', 75, 390);
  46. //facebook
  47. ctx.font = '18px sans-serif';
  48. ctx.fillStyle = '#ffffff';
  49. ctx.fillText ('Facebook', 360, 390);
  50. //Username#Tag
  51. ctx.font = '18px sans-serif';
  52. ctx.fillStyle = '#ffffff';
  53. ctx.fillText (user.tag, 130, 50);
  54. //Note
  55. ctx.font = '18px sans-serif';
  56. ctx.fillStyle = '#837E7E';
  57. ctx.fillText ('note', 30, 240);
  58. //Playing
  59. let gameType = {
  60. 0: 'PLAYING:',
  61. 1: 'STREAMING:',
  62. 2: 'LISTENING:',
  63. 3: 'WATCHING:'
  64. };
  65. //ctx.font = '18px sans-serif';
  66. //ctx.fillStyle = '#ffffff';
  67. //ctx.fillText (gameType [Client.users.cache.get (user.id).presence.status], 130, 70);
  68. //1min dont edit
  69.  
  70.  
  71. ctx.beginPath();
  72. ctx.arc(70, 65, 50, 0, (2 * Math.PI));
  73. // ctx.stroke ();
  74. ctx.clip ();
  75. const avatar = await Canvas.loadImage(user.displayAvatarURL({ format: 'png' }));
  76. //avatar
  77. ctx.drawImage(avatar, 20, 15, 100, 100);
  78.  
  79.  
  80. ctx.drawImage(statusImage, 95, 88, 25, 25);
  81.  
  82.  
  83. Message.channel.send (new Discord.MessageAttachment (canvas.toBuffer ()))
  84. }
  85. });
  86.  
  87.  
  88.  
  89.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement