Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const axios = require('axios');
- module.exports = {
- config: {
- name: "instastalk",
- version: "1.0",
- author: "Samir ล",
- countDown: 5,
- role: 0,
- shortDescription: {
- en: "Stalk Instagram profiles"
- },
- longDescription: {
- en: "Fetch and display information about Instagram profiles."
- },
- category: "Social Media",
- guide: {
- en: "{prefix}instastalk <username>"
- }
- },
- onStart: async function ({ api, event, args }) {
- const username = args[0];
- if (!username) {
- return api.sendMessage("Please provide an Instagram username.", event.threadID);
- }
- try {
- const apiUrl = `https://api-samir.onrender.com/stalk/insta?username=${username}`;
- const { data } = await axios.get(apiUrl);
- const { user_info } = data;
- if (!user_info) {
- return api.sendMessage("Profile not found.", event.threadID);
- }
- const profilePicStream = await global.utils.getStreamFromURL(user_info.profile_pic_url);
- const messageBody = `
- ๐ค Full Name: ${user_info.full_name}
- ๐ Username: @${user_info.username}
- ๐ Biography: ${user_info.biography}
- ๐ External URL: ${user_info.external_url ? user_info.external_url : "does not have"}
- ๐ Private Account: ${user_info.is_private ? "Yes" : "No"}
- โ Verified: ${user_info.is_verified ? "Yes" : "No"}
- ๐ธ Posts: ${user_info.posts}
- ๐ฅ Followers: ${user_info.followers}
- ๐ฃ Following: ${user_info.following}
- `.trim();
- await api.sendMessage({ body: messageBody, attachment: profilePicStream }, event.threadID);
- } catch (error) {
- console.error(error);
- return api.sendMessage("An error occurred while fetching the Instagram profile.", event.threadID);
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement