Advertisement
samiroexpikachu

Profile

Feb 13th, 2024 (edited)
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. async function onStart({ event, message, usersData, args, getLang }) {
  2. let avt;
  3. const uid1 = event.senderID;
  4. const uid2 = Object.keys(event.mentions)[0];
  5. const uid3 = args[0] && /^\d+$/.test(args[0]) ? args[0] : null;
  6.  
  7. if (event.type == "message_reply") {
  8. avt = await usersData.getAvatarUrl(event.messageReply.senderID);
  9. } else {
  10. if (!uid2) {
  11. if (uid3) {
  12. avt = await usersData.getAvatarUrl(uid3);
  13. } else {
  14. const regExCheckURL = /^(http|https):\/\/[^ "]+$/;
  15. const link = args[0];
  16. const uid4 = link ? await global.utils.findUid(link) : null;
  17.  
  18. if (regExCheckURL.test(link) && uid4) {
  19. avt = await usersData.getAvatarUrl(uid4);
  20. } else {
  21. avt = await usersData.getAvatarUrl(uid1);
  22. }
  23. }
  24. } else {
  25. avt = await usersData.getAvatarUrl(uid2);
  26. }
  27. }
  28.  
  29. message.reply({
  30. body: "",
  31. attachment: await global.utils.getStreamFromURL(avt)
  32. });
  33. }
  34.  
  35. const config = {
  36. name: "pp",
  37. aliases: ["profile"],
  38. version: "1.1",
  39. author: "Samir Œ",
  40. countDown: 5,
  41. role: 0,
  42. shortDescription: "profile image",
  43. longDescription: "profile image",
  44. category: "Info",
  45. guide: {
  46. en: " {pn} @tag"
  47. }
  48. };
  49.  
  50. module.exports = {
  51. config,
  52. onStart
  53. };
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement