-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy pathroundv.py
More file actions
39 lines (35 loc) ยท 1.41 KB
/
roundv.py
File metadata and controls
39 lines (35 loc) ยท 1.41 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
37
38
39
from telethon.errors.rpcerrorlist import YouBlockedUserError
from userbot.utils import admin_cmd
# ===================================================================================
@borg.on(admin_cmd(r"roundv$"))
async def _(event):
if event.fwd_from:
return
if not event.reply_to_msg_id:
await event.edit("```Reply to any users message.```")
return
reply_message = await event.get_reply_message()
if not reply_message.media:
await event.edit("```reply to media message```")
return
chat = "@TelescopyBot"
reply_message.sender
if reply_message.sender.bot:
await event.edit("**Reply to actual users message.**")
return
okay = await event.edit("**Processing weit..**")
async with event.client.conversation(chat) as conv:
try:
await conv.send_message("/start")
await conv.get_response()
await conv.send_message(reply_message)
response = await conv.get_response()
await event.client.send_read_acknowledge(conv.chat_id)
except YouBlockedUserError:
await okay.edit("__Please unblock @TelescopyBot and try again__")
return
await okay.delete()
if not response.media:
await event.client.send_message(event.chat_id, response.message)
if response.media:
await event.client.send_file(event.chat_id, response)