Advertisement
samiroexpikachu

Stalk

Apr 10th, 2024 (edited)
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. global.api = {
  3.   samirApi: "https://apis-samir.onrender.com"
  4. };
  5.  
  6. module.exports = {
  7.   config: {
  8.     name: "stalk",
  9.     version: "1.0",
  10.     author: "Samir Œ",
  11.     countDown: 5,
  12.     role: 0,
  13.     shortDescription: "stalk",
  14.     longDescription: "multi stalk command",
  15.     category: "š—œš—”š—™š—¢",
  16.   },  /**User interface designed by Mesbah Bb'e */
  17.   getTargetUID: (event) => {
  18.     if (event.type === "message_reply") {
  19.       return event.messageReply.senderID;
  20.     } else {
  21.       return event.senderID;
  22.     }
  23.   },
  24.  
  25.   getUserInfo: async (api, threadID, targetID) => {
  26.     try {
  27.       const data = await api.getUserInfo(targetID);
  28.       const { name, gender, birthday, isOnline, isFriend, socialMediaLinks, profileUrl } = data[targetID];
  29.       const genderText = gender === 1 ? "female" : gender === 2 ? "male" : "unknown";
  30.       const userName = name || "Name not available";
  31.       const uid = targetID;
  32.       const areFriends = isFriend ? "Yes āœ…" : "No āŒ";
  33.       const fbLink = `https://www.facebook.com/profile.php?id=${uid}`;
  34.       const profilePicURL = profileUrl || "";
  35.       const profilePic = `https://graph.facebook.com/${uid}/picture?width=512&height=512&access_token=6628568379%7Cc1e620fa708a1d5696fb991c1bde5662`;
  36.       const message = {
  37.         body: `
  38.        ā•­ā”€ā”€ć€Ž š—™š—”š—–š—˜š—•š—¢š—¢š—ž š—¦š—§š—”š—Ÿš—ž 怏
  39.        āœ§ Name: ${userName}
  40.        āœ§ UID: ${uid}
  41.        āœ§ Gender: ${genderText}
  42.        āœ§ Friends: ${areFriends}
  43.        āœ§ Facebook Link: ${fbLink}
  44.        āœ§ Profile Picture:
  45.        ā•°ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā—Š`,
  46.         attachment: await global.utils.getStreamFromURL(profilePic),
  47.       };
  48.       api.sendMessage(message, threadID);
  49.     } catch (error) {
  50.       console.error(error);
  51.       api.sendMessage("An error occurred while fetching user information.", threadID);
  52.     }
  53.   },
  54.  
  55.   onStart: async function ({ api, event, args }) {
  56.     const { messageReply, senderID, threadID, type, mentions } = event;
  57.  
  58.     if (args.length > 0 && args[0] === 'fb') {
  59.       const uid = this.getTargetUID(event);
  60.       await this.getUserInfo(api, threadID, uid);
  61.     } else if (args.length > 0 && args[0].toLowerCase() === 'insta') {
  62.       const username = args[1];
  63.       if (!username) {
  64.         return api.sendMessage("Please provide an Instagram username.", event.threadID);
  65.       }
  66.  
  67.       try {
  68.         const apiUrl = `${global.api.samirApi}/stalk/insta?username=${username}`;
  69.         const { data } = await axios.get(apiUrl);
  70.         const { user_info } = data;
  71.  
  72.         if (!user_info) {
  73.           return api.sendMessage("Profile not found.", event.threadID);
  74.         }
  75.  
  76.         const profilePicStream = await global.utils.getStreamFromURL(user_info.profile_pic_url);
  77.         const messageBody = `
  78.         ā•­ā”€ā”€ć€Ž š—œš—”š—¦š—§š—” š—¦š—§š—”š—Ÿš—ž 怏
  79.         ✧ Full Name: ${user_info.full_name}
  80.         ✧ Username: @${user_info.username}
  81.         ✧ Biography: ${user_info.biography}
  82.         ✧ External URL: ${user_info.external_url ? user_info.external_url : "does not have"}
  83.         ✧ Private Account: ${user_info.is_private ? "Yes" : "No"}
  84.         ✧ Verified: ${user_info.is_verified ? "Yes" : "No"}
  85.         ✧ Posts: ${user_info.posts}
  86.         ✧ Followers: ${user_info.followers}
  87.         ✧ Following: ${user_info.following}
  88.         ā•°ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā—Š`.trim();
  89.  
  90.         await api.sendMessage({ body: messageBody, attachment: profilePicStream }, event.threadID);
  91.       } catch (error) {
  92.         console.error(error);
  93.         return api.sendMessage("An error occurred while fetching the Instagram profile.", event.threadID);
  94.       }
  95.     } else if (args.length > 0 && args[0].toLowerCase() === 'tik') {
  96.       const username = args.slice(1).join(" ");
  97.       if (!username) {
  98.         return api.sendMessage("Please provide a TikTok username.", event.threadID);
  99.       }
  100.  
  101.       try {
  102.         const response = await axios.get(`${global.api.samirApi}/tikstalk?username=${encodeURIComponent(username)}`);
  103.         const data = response.data;
  104.  
  105.         let messageBody = `
  106.         ā•­ā”€ā”€ć€Ž š—§š—œš—žš—§š—¢š—ž š—¦š—§š—”š—Ÿš—ž 怏
  107.         ✧ Nickname: ${data.nickname}
  108.         ✧ Username: ${data.username}
  109.         ✧ Video Count: ${data.videoCount}
  110.         ✧ Following Count: ${data.followingCount}
  111.         ✧ Follower Count: ${data.followerCount}
  112.         ✧ Heart Count: ${data.heartCount}
  113.         ✧ Digg Count: ${data.diggCount}
  114.         ā•°ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā—Š`;
  115.  
  116.         api.sendMessage({
  117.           body: messageBody,
  118.           attachment: await global.utils.getStreamFromURL(data.avatarLarger)
  119.         }, event.threadID);
  120.       } catch (error) {
  121.         console.error(error);
  122.         return api.sendMessage("Failed to fetch TikTok user information.", event.threadID);
  123.       }
  124.     } else if (args.length > 0 && args[0].toLowerCase() === 'twitter') {
  125.       const username = args.slice(1).join(" ");
  126.       if (!username) {
  127.         return api.sendMessage("Please provide a Twitter username.", event.threadID);
  128.       }
  129.  
  130.       try {
  131.         const response = await axios.get(`${global.api.samirApi}/tweet/stalk?username=${encodeURIComponent(username)}`);
  132.         const { profile, username: user, name, followers, following, media, statusCount, description } = response.data;
  133.  
  134.         let messageBody = `
  135.         ā•­ā”€ā”€ć€Ž š—§š—Ŗš—œš—§š—§š—˜š—„ š—¦š—§š—”š—Ÿš—ž 怏
  136.         ✧ Name: ${name}\n✧ Username: ${user}
  137.         ✧ Followers: ${followers}
  138.         ✧ Following: ${following}
  139.         ✧ Media: ${media}
  140.         ✧ Status Count: ${statusCount}
  141.         ✧ Description: ${description}
  142.         ā•°ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā—Š`;
  143.  
  144.         await api.sendMessage({
  145.           body: messageBody,
  146.           attachment: await global.utils.getStreamFromURL(profile)
  147.         }, event.threadID);
  148.       } catch (error) {
  149.         console.error(error);
  150.         return api.sendMessage("Failed to fetch Twitter user information.", event.threadID);
  151.       }
  152.     } else if (args.length > 0 && args[0].toLowerCase() === 'pastebin') {
  153.       const username = args[1];
  154.       if (!username) {
  155.         return api.sendMessage("Please provide a Pastebin username.", event.threadID);
  156.       }
  157.  
  158.       try {
  159.         const apiUrl = `${global.api.samirApi}/pastebin/userinfo?name=${encodeURIComponent(username)}`;
  160.         const response = await axios.get(apiUrl);
  161.         const userInfo = response.data;
  162.  
  163.         const messageBody = `
  164.         ā•­ā”€ā”€ć€Ž š—£-š—•š—œš—” š—¦š—§š—”š—Ÿš—ž 怏
  165.         ✧ name ${userInfo.name}
  166.         ✧ Viewing: ${userInfo.viewing}
  167.         ✧ Total Views: ${userInfo.totalViews}
  168.         ✧ Rating: ${userInfo.rating}
  169.         ✧ Joined: ${userInfo.joined}
  170.         ✧ Creation Date: ${userInfo.creationDate}
  171.         ā•°ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā—Š`;
  172.  
  173.         await api.sendMessage({
  174.           body: messageBody,
  175.           attachment: await global.utils.getStreamFromURL(userInfo.userIcon)
  176.         }, event.threadID);
  177.       } catch (error) {
  178.         console.error(error);
  179.         api.sendMessage("An error occurred while fetching Pastebin user information.", event.threadID);
  180.       }
  181.     } else if (args.length > 0 && args[0].toLowerCase() === 'github') {
  182.       const username = args.slice(1).join(" ");
  183.       if (!username) {
  184.         return api.sendMessage("Please provide a GitHub username.", event.threadID);
  185.       }
  186.  
  187.       try {
  188.         const cyclic = 'cyclic';
  189.         const response = await axios.get(`https://api-proxy.${cyclic}.app/gitstalk?user=${username}`);
  190.         const userProfile = response.data.user;
  191.  
  192.         const messageBody = `
  193.         ā•­ā”€ā”€ć€Ž š—šš—œš—§š—›š—Øš—• š—¦š—§š—”š—Ÿš—ž 怏
  194.         ✧ Name: ${userProfile.name}
  195.         ✧ Username: ${userProfile.username}
  196.         ✧ Bio: ${userProfile.bio}
  197.         ✧ Followers: ${userProfile.followers}
  198.         ✧ Following: ${userProfile.following}
  199.         ✧ Total Public Repos: ${userProfile.publicRepos}
  200.         ✧ Location: ${userProfile.location}
  201.         ✧ Creation Date: ${userProfile.createdAt}
  202.         ✧ Profile URL: ${userProfile.githubUrl}
  203.         ✧ Profile Picture:
  204.         ā•°ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā—Š
  205.         `;
  206.         const messageToSend = {
  207.           body: messageBody,
  208.           attachment: await global.utils.getStreamFromURL(userProfile.avatarUrl)
  209.         };
  210.  
  211.         return api.sendMessage(messageToSend, event.threadID);
  212.       } catch (error) {
  213.         console.error(error);
  214.         api.sendMessage("An error occurred while fetching the user information", event.threadID);
  215.       }
  216.     } else {
  217.      api.sendMessage(`ā•­ā”€ā”€ć€Ž š—¦š—§š—”š—Ÿš—ž 怏  
  218. ✧ stalk fb <uid> | <mention>
  219. ✧ stalk insta <username>
  220. ✧ stalk tik <username>
  221. ✧ stalk twitter <username>
  222. ✧ stalk pastebin <username>
  223. ✧ stalk github <username>
  224. ā•°ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā—Š`, threadID);
  225.     }
  226.   },
  227. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement