forked from TeamUltroid/UltroidAddons
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmashup.py
More file actions
34 lines (29 loc) · 1.06 KB
/
mashup.py
File metadata and controls
34 lines (29 loc) · 1.06 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
# created by @Mr_Hops
"""video meme mashup: Avaible commands: .mash <text>
"""
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from userbot.utils import admin_cmd
@borg.on(admin_cmd(pattern="mash ?(.*)"))
async def _(event):
if event.fwd_from:
return
input_str = event.pattern_match.group(1)
await event.get_reply_message()
chat = "@vixtbot"
await event.edit("```Checking...```")
async with event.client.conversation(chat) as conv:
try:
response = conv.wait_event(
events.NewMessage(incoming=True, from_users=285336877)
)
await event.client.send_message(chat, "{}".format(input_str))
response = await response
except YouBlockedUserError:
await event.reply("```Unblock @vixtbot```")
return
if response.text.startswith("I can't find that"):
await event.edit("😐")
else:
await event.delete()
await event.client.send_message(event.chat_id, response.message)