import asyncio
import logging


from aiogram import Bot, Dispatcher
from aiogram.filters.command import Command
from aiogram.types import Message

logging.basicConfig(level=logging.INFO)

bot = Bot(token="7973901636:AAFWl0rsJthS6TEFdMXM2I-jbAR02qPVKxU")

dp = Dispatcher()



@dp.message(Command("start"))
async def cmd_start(message: Message):
    await message.answer("Привет я калькулятор в боте")

@dp.message()
async def echo(message: Message):
    try:
        text = message.text
        result = eval(text)
        await message.answer(f"{text} = {result}")

    except:

        await message.answer("ошибка")


async def main():
    await dp.start_polling(bot)

if __name__ == "__main__":
    asyncio.run(main())
