Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 1.3 KB

README.md

File metadata and controls

49 lines (33 loc) · 1.3 KB

Python Telegram Bot Starter

This is simple Python Telegram Bot.

Deploy to Cyclic in seconds

Deploy to Cyclic

  1. Set server.py as your entry point.
  2. Create a new Telegram bot using BotFather
  3. Store the bot token into a BOT_TOKEN environment variable
  4. Create a SECRET_TOKEN and set it in the SECRET_TOKEN environment variable
  5. Run the following curl substituting the appropriate variables:
    curl https://api.telegram.org/bot${BOT_TOKEN}/setWebhook
        -F "url=https://${CYCLIC_URL}/webhook/" \
        -F "secret_token=${SECRET_TOKEN}"
    
  6. Message you bot with /start or just say Hello!
  7. Check your bot's status: https://api.telegram.org/bot${BOT_TOKEN}/getWebhookInfo

Run Locally

Prerequisites:

  • pyenv
  • python 3.10.11

Install: bin/install

  • creates virtual env
  • installs dependencies from requirements.txt

Run: bin/dev

  • runs a uvicorn server in reload mode

Run: bin/start

  • runs a uvicorn server

Helpful Docs:

Questions / Help

Join us on Discord: https://discord.cyclic.sh

Enjoy!