File size: 803 Bytes
799fa63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import time
import logging
from aiogram import Bot, types, Dispatcher
from aiogram.utils import executor
from env import TOKEN
from test_copy import process_text

bot = Bot(TOKEN)
dp = Dispatcher(bot=bot)

@dp.message_handler(commands=['start'])
async def start_handler(message: types.Message):
    user_id = message.from_user.id
    user_name = message.from_user.first_name
    logging.info(f'{user_id} {time.asctime()}')

    await message.reply(f"Салам, {user_name} !!!!!\nТекст киргизиңиз:")

@dp.message_handler(state=None)
async def message_handler(message: types.Message):
    processed_text = process_text(message.text)
    await message.reply(f"Оңдолгон текст:\n\n{processed_text}")

if __name__ == '__main__':
    executor.start_polling(dp, skip_updates=True)