1def echo(update, context):
2 context.bot.send_message(chat_id=update.effective_chat.id, text=update.message.text)
3
4from telegram.ext import MessageHandler, Filters
5echo_handler = MessageHandler(Filters.text & (~Filters.command), echo)
6dispatcher.add_handler(echo_handler)