forked from TeamUltroid/UltroidAddons
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcovid-v2.py
More file actions
36 lines (32 loc) · 1.26 KB
/
covid-v2.py
File metadata and controls
36 lines (32 loc) · 1.26 KB
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
# @TechnoAyanOfficial
# Big Thanks To Spechide and ItWaze
"""Corona: Avaible commands: .covid <cname>
"""
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from userbot.utils import admin_cmd
@borg.on(admin_cmd(pattern="covid ?(.*)"))
async def _(event):
if event.fwd_from:
return
input_str = event.pattern_match.group(1)
await event.get_reply_message()
chat = "@NovelCoronaBot"
await event.edit("```Checking...```")
async with event.client.conversation(chat) as conv:
try:
response = conv.wait_event(
events.NewMessage(incoming=True, from_users=1124136160)
)
await event.client.send_message(chat, "{}".format(input_str))
response = await response
except YouBlockedUserError:
await event.reply("```Boss! Please Unblock (@NovelCoronaBot) ```")
return
if response.text.startswith("Country"):
await event.edit(
"😶**Country Not Found**😅\n\n[🔴🔴🔴🔴\n ⏩⏩ How to use ⏪⏪\n🔵🔵🔵🔵](https://t.me/blacklightningot)"
)
else:
await event.delete()
await event.client.send_message(event.chat_id, response.message)