Skip to content

Latest commit

 

History

History
45 lines (37 loc) · 1.53 KB

File metadata and controls

45 lines (37 loc) · 1.53 KB

Setup & Bot Configuration

One-time setup. After this, day-to-day use is just the Quick Start.

Prerequisites

  • Python 3 — Install via python.org or Homebrew (brew install python3)
  • pip3 — Typically bundled with Python 3; otherwise brew install pip3
  • virtualenvpip3 install virtualenv

Install

  1. Clone the repository:
    git clone <repository-url>
    cd telegram-bot
  2. Create and activate a virtual environment:
    virtualenv env-telegram-bot
    source env-telegram-bot/bin/activate
  3. Install dependencies:
    pip3 install -r requirements.txt

Telegram Bot Configuration

  1. Download and install the Telegram Desktop App.
  2. Create a new bot by messaging BotFather.
  3. Obtain the API token.
    • For an existing bot, send /mybots to BotFather, select the bot, and click API Token.
  4. Create a .env file in the project root:
    touch .env
  5. Add your token in this format:
    API_KEY = "110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw"
    
  6. Create at least one Telegram group chat and add your bot as a member. That group will receive the message when the script runs.

Next: add your recipient groups — see Recipient Groups.