Skip to content

Commit

Permalink
Create ip.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kappithannemo authored Jun 19, 2021
1 parent 1579659 commit 3fcb656
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions plugins/ip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
const Asena = require('../events');
const Config = require('../config');
const {MessageType} = require('@adiwajshing/baileys');
const got = require('got');

// List
const IPSTATUS_DESC = "It Sends Your IP details"
const NEED_IP = "*Enter Your IP Address..!*"
const IP = "IP :"
const ST = "STATUS :"
const CONTINENT = "CONTINENT :"
const COUNTRY = "COUNTRY :"
const COUNTRYCODE = "COUNTRYCODE :"
const REGIONNAME = "REGIONNAME :"
const CITY = "CITY :"
const ZIP = "ZIP :"
const CURRENCY = "CURRENCY :"
const ISP = "ISP :"
const MOBILE = "MOBILE :"
const PROXY = "PROXY :"
const NOT_FOUNDIP = "```Sorry,I could not your IP πŸ˜–```"




Asena.addCommand({pattern: 'ip ?(.*)', desc: 'gives you the detail of your IP' ,fromMe: false}, async (message, match) => {

if (match[1] === '') return await message.reply(NEED_IP);
const url = `https://api.techniknews.net/ipgeo/${match[1]}`;
try {
const response = await got(url);
const ipjson = JSON.parse(response.body);
if (response.statusCode === 200) return await message.client.sendMessage(message.jid, '*πŸ”΄ ' + IP +'* ```' + match[1] + '```\n\n' +
'*βœ…' + ST +'* ```' + ipjson.status+ '```\n' +
'*🌐' + CONTINENT +'* ```' + ipjson.continent+ '```\n' +
'*πŸ—Ί' + COUNTRY +'* ```' + ipjson.country+ '```\n' +
'*πŸ”’' + COUNTRYCODE +'* ```' + ipjson.countryCode+ '```\n' +
'*🌍' + REGIONNAME +'* ```' + ipjson.regionName+ '```\n' +
'*🚩' + CITY +'* ```' + ipjson.city+ '```\n' +
'*πŸ›' + ZIP +'* ```' + ipjson.zip+ '```\n' +
'*πŸ’Έ' + CURRENCY +'* ```' + ipjson.currency+ '```\n\n' +
'*πŸ“‘' + ISP +'* ```' + ipjson.isp+ '```\n' +
'*πŸ›‘' + PROXY +'* ```' + ipjson.proxy+ '```\n' +
'*πŸ“±' + MOBILE +'* ```' + ipjson.mobile+ '```\n', MessageType.text);
}
catch {
return await message.client.sendMessage(message.jid, NOT_FOUNDIP, MessageType.text);
}
});

0 comments on commit 3fcb656

Please sign in to comment.