case 'github': {
if (!text) return reply(โ ๏ธ Usage: ${command} \n\nExample: ${command} torvalds)
try {
let res = await axios.get(https://api.github.com/users/${encodeURIComponent(text)})
let user =
res.data if (!user || !user.login) return reply("โ User not found.")
let profileInfo = ๐จโ๐ป *GitHub Profile*\n
๐ค Name: ${user.name || "N/A"}
๐ Username: ${user.login}
๐ Location: ${user.location || "N/A"}
๐ฆ Public Repos: ${user.public_repos}
๐ฅ Followers: ${user.followers}
๐ค Following: ${user.following}
๐
Created: ${new Date(user.created_at).toLocaleDateString()}
๐ Profile: ${user.html_url}
// Send profile pic + info
await minato.sendMessage(
m.chat, {
image: { url: user.avatar_url },
caption: profileInfo
}, { quoted: m })
} catch (e) {
console.error(e)
reply("โ ๏ธ Failed to fetch GitHub profile. Try again.")
}
}
break
case 'npm': {
if (!text) return reply(โ ๏ธ Usage: ${command} \n\nExample: ${command} axios)
try {
let res = await axios.get(https://registry.npmjs.org/${encodeURIComponent(text)})
let data =
res.data if (!
data.name) return reply("โ Package not found.")
// Get latest version
let latestVersion = data['dist-tags']?.latest
let info = data.versions[latestVersion]
let npmInfo = ๐ฆ *NPM Package Info*\n
๐ Name: ${data.name}
๐ Latest Version: ${latestVersion}
๐ Description: ${data.description || "N/A"}
๐ค Author: ${info?.author?.name || "N/A"}
๐
Published: ${info?.date || "N/A"}
๐ฆ License: ${info?.license || "N/A"}
๐ Homepage: ${info?.homepage || "N/A"}
๐ NPM:
https://www.npmjs.com/package/${data.name}
reply(npmInfo.trim())
} catch (e) {
console.error(e)
reply("โ ๏ธ Failed to fetch NPM package info. Try again.")
}
}
break;