Skip to content

Instantly share code, notes, and snippets.

@mrhalix
Created May 9, 2019 10:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mrhalix/2b09c8a95f83e6f4de2ea18f4268992f to your computer and use it in GitHub Desktop.
Save mrhalix/2b09c8a95f83e6f4de2ea18f4268992f to your computer and use it in GitHub Desktop.
Simple Python Telegram bot / https://aminaleahmad.ir / https://bit.ly/2H9zpvY
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