Skip to main content

A Telegram bot library, with simple route decorators.

Project description

telebot
-------

A Telegram bot library, with simple route decorators.

Currently a work in progress, doesn't do much now, but will register and send messages.

Example Setup
^^^^^^^^^^^^^

from telebot import TeleBot

app = TeleBot(__name__)


@app.route('/command ?(.*)')
def example_command(message, cmd):
chat_dest = message['chat']['id']
msg = "Command Recieved: {}".format(cmd)

app.send_message(chat_dest, msg)


@app.route('(?!/).+')
def parrot(message):
chat_dest = message['chat']['id']
user_msg = message['text']

msg = "Parrot Says: {}".format(user_msg)
app.send_message(chat_dest, msg)


if __name__ == '__main__':
app.config['api_key'] = 'xxxxxxxx:enterYourBotKeyHereToTest'
app.poll(debug=True)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telebot-0.0.1.tar.gz (3.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page