Skip to content

Instantly share code, notes, and snippets.

Last active May 10, 2016
What would you like to do?
# -*- coding: utf-8 -*-
import telebot
from telebot import types
USER_WELCOME = "Bienvenido al servicio de HomeHub."
USER_REGISTERED = "{}, te hemos registrado en nuestro sistema."
TOKEN = "123456789:TOKEN4529424024-ConfiguraTuTokenXDXDXDXD"
bot = telebot.TeleBot(TOKEN)
# class Contact(object):
rcadmin = {
'first_name': 'Richard',
'last_name': 'Cotrina',
'phone_number': '+51999999999'
def send_welcome(message):
bot.send_message(, USER_WELCOME)
bot.send_message(, USER_REGISTERED.format(
def say_hello(message):
bot.send_message(, "Hola.")
@bot.message_handler(commands=['help', 'ayuda'])
def help_message(message):
bot.send_message(, u"Aquí debe mostrarse un mensaje de ayuda")
@bot.message_handler(func=lambda m: True)
def echo_all(message):
# bot.send_chat_action(, action='typing')
bot.reply_to(message, u"No te entiendo ¿Qué se supone que significa {}?".format(message.text))
# Log all messages:
def handle_messages(messages):
for message in messages:
print "{}: {}".format(, message.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment