Skip to main content

A Telegram bot library, with simple route decorators.

Project description

Note: This is not pyTelegramBotAPI, but do to often confusion I have included it within this package. So if you accidentally install this instead of pyTelegramBotAPI the examples, etc will still work.

This originally was telegram bot library, with simple route decorators, and will now be imported as telebot_router, to separate pyTelegramBotAPI and this package from collision.

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

Example Setup

from telebot_router 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.5.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

telebot-0.0.5-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file telebot-0.0.5.tar.gz.

File metadata

  • Download URL: telebot-0.0.5.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for telebot-0.0.5.tar.gz
Algorithm Hash digest
SHA256 848a5885b57247b65edd0e92647b4372ebd8d41611dca3f344788c11deac2571
MD5 89c1f70cac1a447e408d7026cff9f491
BLAKE2b-256 1f3be4188cffaf370f432f15d518cbb53a438200ee7ef68c6db1acab337634e1

See more details on using hashes here.

File details

Details for the file telebot-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: telebot-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for telebot-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 50327c240243480d40ade4ea5bea4f464bf57d4ff000ea669fcd705396074863
MD5 a386e0f3ec730f05191e6310e32c178e
BLAKE2b-256 ad2fd8d669be86c42dd2075d7b25bb6de73a3181661a79ef6a3c53dc811f17a1

See more details on using hashes here.

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