forked from kappithannemo/WhatsAsenaDuplicated
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1579659
commit 3fcb656
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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); | ||
} | ||
}); |