Spaces:
Runtime error
Runtime error
import logging | |
from aiogram import Bot, Dispatcher, executor, types | |
API_TOKEN = '6184585778:AAEwvLKXANtI-z7LeCmBlZ8PrNXBsf426W4' | |
# Configure logging | |
logging.basicConfig(level=logging.INFO) | |
# Initialize bot and dispatcher | |
bot = Bot(token=API_TOKEN) | |
dp = Dispatcher(bot) | |
async def send_welcome(message: types.Message): | |
""" | |
This handler will be called when user sends `/start` or `/help` command | |
""" | |
await message.reply("Привет!\nМеня зовут Сенкаро!\nБуду рад провести время с тобой.") | |
async def send_message(message: types.Message): | |
await message.reply("Сообщение отправлено!") | |
async def echo(message: types.Message): | |
# old style: | |
# await bot.send_message(message.chat.id, message.text) | |
await message.answer(message.text) | |
if __name__ == '__main__': | |
executor.start_polling(dp, skip_updates=True) |