-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathChat_tio
27 lines (26 loc) · 1.19 KB
/
Chat_tio
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
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from .. import loader, utils
import asyncio
def register(cb):
cb(chatMod())
class chatMod(loader.Module):
"""Модуль может кинуть рандомный чат"""
strings = {'name': 'RandomChat_tio'}
async def чатcmd(self, message):
""".чат чтобы получить ссылку на чат"""
state = "🔀 Случайная беседа"
await message.edit("<b>by tio...</b>")
chat = '@iris_cm_bot'
async with message.client.conversation(chat) as conv:
try:
await message.edit("<b>by tioTemma...</b>")
response = conv.wait_event(events.NewMessage(incoming=True, from_users=707693258))
bot_send_message = await message.client.send_message(chat, format(state))
bot_response = response = await response
except YouBlockedUserError:
await message.edit('<b>Убери из ЧС:</b> ' chat)
return
await bot_send_message.delete()
await message.edit(response.text)
await bot_response.delete()