Advertisement
samiroexpikachu

Instastalk

Mar 2nd, 2024
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. const axios = require('axios');
  2.  
  3. module.exports = {
  4. config: {
  5. name: "instastalk",
  6. version: "1.0",
  7. author: "Samir ล’",
  8. countDown: 5,
  9. role: 0,
  10. shortDescription: {
  11. en: "Stalk Instagram profiles"
  12. },
  13. longDescription: {
  14. en: "Fetch and display information about Instagram profiles."
  15. },
  16. category: "Social Media",
  17. guide: {
  18. en: "{prefix}instastalk <username>"
  19. }
  20. },
  21.  
  22. onStart: async function ({ api, event, args }) {
  23. const username = args[0];
  24.  
  25. if (!username) {
  26. return api.sendMessage("Please provide an Instagram username.", event.threadID);
  27. }
  28.  
  29. try {
  30. const apiUrl = `https://api-samir.onrender.com/stalk/insta?username=${username}`;
  31. const { data } = await axios.get(apiUrl);
  32. const { user_info } = data;
  33.  
  34. if (!user_info) {
  35. return api.sendMessage("Profile not found.", event.threadID);
  36. }
  37.  
  38. const profilePicStream = await global.utils.getStreamFromURL(user_info.profile_pic_url);
  39.  
  40. const messageBody = `
  41. ๐Ÿ‘ค Full Name: ${user_info.full_name}
  42. ๐Ÿ†” Username: @${user_info.username}
  43. ๐Ÿ“ Biography: ${user_info.biography}
  44. ๐Ÿ”— External URL: ${user_info.external_url ? user_info.external_url : "does not have"}
  45. ๐Ÿ”’ Private Account: ${user_info.is_private ? "Yes" : "No"}
  46. โœ” Verified: ${user_info.is_verified ? "Yes" : "No"}
  47. ๐Ÿ“ธ Posts: ${user_info.posts}
  48. ๐Ÿ‘ฅ Followers: ${user_info.followers}
  49. ๐Ÿ‘ฃ Following: ${user_info.following}
  50. `.trim();
  51.  
  52.  
  53. await api.sendMessage({ body: messageBody, attachment: profilePicStream }, event.threadID);
  54. } catch (error) {
  55. console.error(error);
  56. return api.sendMessage("An error occurred while fetching the Instagram profile.", event.threadID);
  57. }
  58. }
  59. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement