Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global.api = {
- samirApi: "https://apis-samir.onrender.com"
- };
- module.exports = {
- config: {
- name: "stalk",
- version: "1.0",
- author: "Samir Å",
- countDown: 5,
- role: 0,
- shortDescription: "stalk",
- longDescription: "multi stalk command",
- category: "šš”šš¢",
- }, /**User interface designed by Mesbah Bb'e */
- getTargetUID: (event) => {
- if (event.type === "message_reply") {
- return event.messageReply.senderID;
- } else {
- return event.senderID;
- }
- },
- getUserInfo: async (api, threadID, targetID) => {
- try {
- const data = await api.getUserInfo(targetID);
- const { name, gender, birthday, isOnline, isFriend, socialMediaLinks, profileUrl } = data[targetID];
- const genderText = gender === 1 ? "female" : gender === 2 ? "male" : "unknown";
- const userName = name || "Name not available";
- const uid = targetID;
- const areFriends = isFriend ? "Yes ā " : "No ā";
- const fbLink = `https://www.facebook.com/profile.php?id=${uid}`;
- const profilePicURL = profileUrl || "";
- const profilePic = `https://graph.facebook.com/${uid}/picture?width=512&height=512&access_token=6628568379%7Cc1e620fa708a1d5696fb991c1bde5662`;
- const message = {
- body: `
- āāāć šššššš¢š¢š š¦š§ššš ć
- ā§ Name: ${userName}
- ā§ UID: ${uid}
- ā§ Gender: ${genderText}
- ā§ Friends: ${areFriends}
- ā§ Facebook Link: ${fbLink}
- ā§ Profile Picture:
- ā°āāāāāāāāāāāā`,
- attachment: await global.utils.getStreamFromURL(profilePic),
- };
- api.sendMessage(message, threadID);
- } catch (error) {
- console.error(error);
- api.sendMessage("An error occurred while fetching user information.", threadID);
- }
- },
- onStart: async function ({ api, event, args }) {
- const { messageReply, senderID, threadID, type, mentions } = event;
- if (args.length > 0 && args[0] === 'fb') {
- const uid = this.getTargetUID(event);
- await this.getUserInfo(api, threadID, uid);
- } else if (args.length > 0 && args[0].toLowerCase() === 'insta') {
- const username = args[1];
- if (!username) {
- return api.sendMessage("Please provide an Instagram username.", event.threadID);
- }
- try {
- const apiUrl = `${global.api.samirApi}/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);
- }
- } else if (args.length > 0 && args[0].toLowerCase() === 'tik') {
- const username = args.slice(1).join(" ");
- if (!username) {
- return api.sendMessage("Please provide a TikTok username.", event.threadID);
- }
- try {
- const response = await axios.get(`${global.api.samirApi}/tikstalk?username=${encodeURIComponent(username)}`);
- const data = response.data;
- let messageBody = `
- āāāć š§ššš§š¢š š¦š§ššš ć
- ā§ Nickname: ${data.nickname}
- ā§ Username: ${data.username}
- ā§ Video Count: ${data.videoCount}
- ā§ Following Count: ${data.followingCount}
- ā§ Follower Count: ${data.followerCount}
- ā§ Heart Count: ${data.heartCount}
- ā§ Digg Count: ${data.diggCount}
- ā°āāāāāāāāāāāā`;
- api.sendMessage({
- body: messageBody,
- attachment: await global.utils.getStreamFromURL(data.avatarLarger)
- }, event.threadID);
- } catch (error) {
- console.error(error);
- return api.sendMessage("Failed to fetch TikTok user information.", event.threadID);
- }
- } else if (args.length > 0 && args[0].toLowerCase() === 'twitter') {
- const username = args.slice(1).join(" ");
- if (!username) {
- return api.sendMessage("Please provide a Twitter username.", event.threadID);
- }
- try {
- const response = await axios.get(`${global.api.samirApi}/tweet/stalk?username=${encodeURIComponent(username)}`);
- const { profile, username: user, name, followers, following, media, statusCount, description } = response.data;
- let messageBody = `
- āāāć š§šŖšš§š§šš„ š¦š§ššš ć
- ā§ Name: ${name}\nā§ Username: ${user}
- ā§ Followers: ${followers}
- ā§ Following: ${following}
- ā§ Media: ${media}
- ā§ Status Count: ${statusCount}
- ā§ Description: ${description}
- ā°āāāāāāāāāāāā`;
- await api.sendMessage({
- body: messageBody,
- attachment: await global.utils.getStreamFromURL(profile)
- }, event.threadID);
- } catch (error) {
- console.error(error);
- return api.sendMessage("Failed to fetch Twitter user information.", event.threadID);
- }
- } else if (args.length > 0 && args[0].toLowerCase() === 'pastebin') {
- const username = args[1];
- if (!username) {
- return api.sendMessage("Please provide a Pastebin username.", event.threadID);
- }
- try {
- const apiUrl = `${global.api.samirApi}/pastebin/userinfo?name=${encodeURIComponent(username)}`;
- const response = await axios.get(apiUrl);
- const userInfo = response.data;
- const messageBody = `
- āāāć š£-ššš” š¦š§ššš ć
- ā§ name ${userInfo.name}
- ā§ Viewing: ${userInfo.viewing}
- ā§ Total Views: ${userInfo.totalViews}
- ā§ Rating: ${userInfo.rating}
- ā§ Joined: ${userInfo.joined}
- ā§ Creation Date: ${userInfo.creationDate}
- ā°āāāāāāāāāāāā`;
- await api.sendMessage({
- body: messageBody,
- attachment: await global.utils.getStreamFromURL(userInfo.userIcon)
- }, event.threadID);
- } catch (error) {
- console.error(error);
- api.sendMessage("An error occurred while fetching Pastebin user information.", event.threadID);
- }
- } else if (args.length > 0 && args[0].toLowerCase() === 'github') {
- const username = args.slice(1).join(" ");
- if (!username) {
- return api.sendMessage("Please provide a GitHub username.", event.threadID);
- }
- try {
- const cyclic = 'cyclic';
- const response = await axios.get(`https://api-proxy.${cyclic}.app/gitstalk?user=${username}`);
- const userProfile = response.data.user;
- const messageBody = `
- āāāć ššš§ššØš š¦š§ššš ć
- ā§ Name: ${userProfile.name}
- ā§ Username: ${userProfile.username}
- ā§ Bio: ${userProfile.bio}
- ā§ Followers: ${userProfile.followers}
- ā§ Following: ${userProfile.following}
- ā§ Total Public Repos: ${userProfile.publicRepos}
- ā§ Location: ${userProfile.location}
- ā§ Creation Date: ${userProfile.createdAt}
- ā§ Profile URL: ${userProfile.githubUrl}
- ā§ Profile Picture:
- ā°āāāāāāāāāāāā
- `;
- const messageToSend = {
- body: messageBody,
- attachment: await global.utils.getStreamFromURL(userProfile.avatarUrl)
- };
- return api.sendMessage(messageToSend, event.threadID);
- } catch (error) {
- console.error(error);
- api.sendMessage("An error occurred while fetching the user information", event.threadID);
- }
- } else {
- api.sendMessage(`āāāć š¦š§ššš ć
- ā§ stalk fb <uid> | <mention>
- ā§ stalk insta <username>
- ā§ stalk tik <username>
- ā§ stalk twitter <username>
- ā§ stalk pastebin <username>
- ā§ stalk github <username>
- ā°āāāāāāāāāāāā`, threadID);
- }
- },
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement