Skip to content

Instantly share code, notes, and snippets.

@iliakonnov
Last active December 28, 2016 13:41
Show Gist options
  • Save iliakonnov/05e1bf2e36b77baa317604528f0fc983 to your computer and use it in GitHub Desktop.
Save iliakonnov/05e1bf2e36b77baa317604528f0fc983 to your computer and use it in GitHub Desktop.
pyTelegramBotApi test
import telebot
bot = telebot.TeleBot("TOKEN") # This token is not valid, you should obtain your token from @BotFather bot (https://core.telegram.org/bots#botfather)
@bot.message_handler(commands=['start', 'help'])
def send_welcome(message):
bot.reply_to(message, "Howdy, how are you doing?")
@bot.message_handler(func=lambda message: True)
def echo_all(message):
bot.reply_to(message, message.text)
bot.polling()
import telebot
bot = telebot.TeleBot("279863450:AAFrWKIJbXTRGNh6apgC6a_AjCvzyRBdqJg") # I deleted the bot with this token.
@bot.message_handler(commands=['start', 'help'])
def send_welcome(message):
bot.reply_to(message, "Howdy, how are you doing?")
@bot.message_handler(func=lambda message: True)
def echo_all(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