Skip to content

Instantly share code, notes, and snippets.

@alages97
Created April 17, 2020 16:54
Show Gist options
  • Save alages97/af3308d291551d7443e8b39dce787076 to your computer and use it in GitHub Desktop.
Save alages97/af3308d291551d7443e8b39dce787076 to your computer and use it in GitHub Desktop.
@bot.message_handler(commands=['start']) # welcome message handler
def send_welcome(message):
bot.reply_to(message, 'Hello! I am bot')
@bot.message_handler(commands=['help']) # help message handler
def send_welcome(message):
bot.reply_to(message, 'Help message')
@bot.message_handler(func=lambda message: True) # makes the bot imitate the user's message
def echo_all(message):
bot.reply_to(message, message.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment