Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf8 -*-
- from aiogram import Bot, types
- from aiogram.dispatcher import Dispatcher
- from aiogram.utils import executor
- from config import TOKEN
- bot = Bot(token=TOKEN)
- dp = Dispatcher(bot)
- @dp.message_handler(commands=['start'])
- async def process_start_command(message: types.Message):
- await message.reply("Привет!\nНапиши мне что-нибудь!")
- @dp.message_handler(commands=['help'])
- async def process_help_command(message: types.Message):
- await message.reply("Напиши мне что-нибудь, и я отпрпавлю этот текст тебе в ответ!")
- @dp.message_handler()
- async def echo_message(msg: types.Message):
- await bot.send_message(msg.from_user.id, msg.text)
- if __name__ == '__main__':
- executor.start_polling(dp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement