-
Notifications
You must be signed in to change notification settings - Fork 0
/
countries.py
105 lines (100 loc) · 2.57 KB
/
countries.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
from main_startup.core.decorators import friday_on_cmd
from main_startup.helper_func.basic_helpers import edit_or_reply, get_text
import flag
import html
from countryinfo import CountryInfo
@friday_on_cmd(
["country", "Countries"],
is_official=False,
cmd_help={
"help": "Get Information About Any Country",
"example": "{ch}country India",
},
)
async def country_(client, message):
msg_ = await edit_or_reply(message, "`Searching For Country.....`")
lol = get_text(message)
if not lol:
await msg_.edit("`Please Give Input!`")
return
country = CountryInfo(lol)
try:
a = country.info()
except:
await msg_.edit("`Country Not Found. Maybe You Need to Learn Geography!`")
return
name = a.get("name")
bb = a.get("altSpellings")
hu = ""
for p in bb:
hu += p + ", "
area = a.get("area")
borders = ""
hell = a.get("borders")
for fk in hell:
borders += fk + ", "
call = ""
WhAt = a.get("callingCodes")
for what in WhAt:
call+= what + " "
capital = a.get("capital")
currencies = ""
fker = a.get("currencies")
for FKer in fker:
currencies += FKer + ", "
HmM = a.get("demonym")
geo = a.get("geoJSON")
pablo = geo.get("features")
Pablo = pablo[0]
PAblo = Pablo.get("geometry")
EsCoBaR = PAblo.get("type")
iso = ""
iSo = a.get("ISO")
for hitler in iSo:
po = iSo.get(hitler)
iso += po + ", "
fla = iSo.get("alpha2")
nox = fla.upper()
okie = flag.flag(nox)
languages = a.get("languages")
lMAO = ""
for lmao in languages:
lMAO += lmao + ", "
nonive = a.get("nativeName")
waste = a.get("population")
reg = a.get("region")
sub = a.get("subregion")
tik = a.get("timezones")
tom = ""
for jerry in tik:
tom += jerry + ", "
GOT = a.get("tld")
lanester = ""
for targaryen in GOT:
lanester += targaryen + ", "
wiki = a.get("wiki")
caption = f"""<b><u>information gathered successfully</b></u>
<b>
Country Name:- {name}
Alternative Spellings:- {hu}
Country Area:- {area} square kilometers
Borders:- {borders}
Calling Codes:- {call}
Country's Capital:- {capital}
Country's currency:- {currencies}
Country's Flag:- {okie}
Demonym:- {HmM}
Country Type:- {EsCoBaR}
ISO Names:- {iso}
Languages:- {lMAO}
Native Name:- {nonive}
population:- {waste}
Region:- {reg}
Sub Region:- {sub}
Time Zones:- {tom}
Top Level Domain:- {lanester}
wikipedia:- {wiki}</b>
<u><b>
Information Gathered By satya
"""
await msg_.edit(caption, parse_mode="html")