-
Notifications
You must be signed in to change notification settings - Fork 1
/
Valutes_convertor
27 lines (26 loc) · 1.19 KB
/
Valutes_convertor
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(ValuteMod())
class ValuteMod(loader.Module):
"""Конвертер Валют"""
strings = {'name': 'Конвертер Валют💶'}
async def valcmd(self, message):
""".val количество валюта"""
state = utils.get_args_raw(message)
await message.edit("<b>Данные получены</b>")
chat = '@exchange_rates_vsk_bot'
async with message.client.conversation(chat) as conv:
try:
await message.edit("<b>Конвертирую...</b>")
response = conv.wait_event(events.NewMessage(incoming=True, from_users=1210425892))
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()