Skip to content

Instantly share code, notes, and snippets.

@Kenichi-md
Forked from Mr-rabbit-xd/checkcode.js
Last active March 30, 2025 09:38
Show Gist options
  • Save Kenichi-md/174c46bad7f9a1da5461bdfc67ca0842 to your computer and use it in GitHub Desktop.
Save Kenichi-md/174c46bad7f9a1da5461bdfc67ca0842 to your computer and use it in GitHub Desktop.
const { bot, lang } = require('../lib/');
const axios = require("axios");
bot(
{
pattern: 'oyeoye ?(.*)', //
desc: 'check a phone number and get country details. \n\n' + Buffer.from('PiAqIFBvd2VyZWQgQnkgTVItUkFCQklU', 'base64').toString('utf-8'),
type: 'misc',
},
async (_0x1a2b3c, _0x4d5e6f) => {
if (!_0x4d5e6f) return await _0x1a2b3c.send("❌ Please provide a phone number!\nExample: *!checkcode +8801712345678*");
let _0x7g8h9i = _0x4d5e6f.trim();
let _0x2j3k4l = _0x7g8h9i.replace(/\D/g, "").substring(0, 3);
try {
const _0x5m6n7o = await axios.get(`https://restcountries.com/v2/callingcode/${_0x2j3k4l}`);
const _0x8p9q0r = _0x5m6n7o.data[0];
let _0x1s2t3u = `🌍 *Country:* ${_0x8p9q0r.name}\n`;
_0x1s2t3u += `πŸ™ *Capital:* ${_0x8p9q0r.capital}\n`;
_0x1s2t3u += `πŸ—£ *Language:* ${_0x8p9q0r.languages.map(_0x3v4w5x => _0x3v4w5x.name).join(", ")}\n`;
_0x1s2t3u += `πŸ’° *Currency:* ${_0x8p9q0r.currencies.map(_0x6y7z8a => _0x6y7z8a.name).join(", ")}\n`;
_0x1s2t3u += `πŸ“ *Region:* ${_0x8p9q0r.region}\n\n`;
_0x1s2t3u += ` *` + Buffer.from('PiAqIFBvd2VyZWQgQnkgTVItUkFCQklU', 'base64').toString('utf-8') + `*`;
return await _0x1a2b3c.send(_0x1s2t3u);
} catch (_0x9b0c1d) {
return await _0x1a2b3c.send("❌ Invalid Number or Country Code Not Found!");
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment