Created
May 9, 2019 10:28
-
-
Save mrhalix/2b09c8a95f83e6f4de2ea18f4268992f to your computer and use it in GitHub Desktop.
Simple Python Telegram bot / https://aminaleahmad.ir / https://bit.ly/2H9zpvY
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import telebot | |
# Replace API_TOKEN with your token, which can be gotten through @botfather . | |
API_TOKEN = 'XXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | |
bot = telebot.TeleBot(API_TOKEN) | |
@bot.message_handler(commands=['help', 'start']) | |
def send_welcome(message): | |
bot.reply_to(message, "Hi there, I am EchoBot.") | |
@bot.message_handler(func=lambda message: True) | |
def echo_message(message): | |
bot.reply_to(message, message.text) | |
bot.polling() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment