A Telegram bot library, with simple route decorators.
Project description
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.3.tar.gz
(3.7 kB
view details)
File details
Details for the file telebot-0.0.3.tar.gz.
File metadata
- Download URL: telebot-0.0.3.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9f9dfd706de3ea10d1bb626dc8c453f98b8daaabfdd11030ea7506ced0a914a
|
|
| MD5 |
99114ef13b6011af68adf7b9c678f74c
|
|
| BLAKE2b-256 |
65e02494a32a7857638215d2368fce0c6ae342157d3a74c1dcd8b2305f5da372
|