-
-
Save Kenichi-md/174c46bad7f9a1da5461bdfc67ca0842 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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