Skip to content

Latest commit

 

History

History
85 lines (56 loc) · 1.85 KB

README.MD

File metadata and controls

85 lines (56 loc) · 1.85 KB

Telegram Bot Project

Overview

This repository contains the code for a Telegram bot developed using the python-telegram-bot library. The bot serves messaging at scheduled times, even if you are offline.


Prerequisites

Ensure the following are installed or available before setting up the bot:

  • Python 3.8 or 10 installed
  • Telegram account
  • PythonAnywhere account

Installation

  1. Clone Repository:

    git clonehttps://github.com/ktwillcode/Telegram-Bot--Botty.git
    cd Telegram-Bot--Botty
  2. Install Dependencies:

    pip install python-telegram-bot

Setting up the Telegram Bot

  1. Create a Bot via BotFather:

    • Open Telegram and search for BotFather.
    • Follow the steps to create a new bot and obtain the API token.
  2. Configure the Bot:

    • Open the botty.py file.
    • Replace 'YOUR_API_TOKEN' with the obtained API token.

Running the Bot Locally

  1. Run the Bot:

    python your_bot_script.py
  2. Interacting with the Bot:

    • Open Telegram and search for your bot by its username.
    • Start interacting with the bot by sending messages or commands.

Deploying the Bot on PythonAnywhere

  1. Upload the Bot Script:

    • Upload the bot script (botty.py) to PythonAnywhere.
  2. Install Dependencies on PythonAnywhere:

    • Open a Bash console on PythonAnywhere.
    • Install the python-telegram-bot library:
    pip3.8 install --user python-telegram-bot
  3. Schedule the Bot:

    • Use the PythonAnywhere interface to create a scheduled task.
    • Set the task command:
    /usr/bin/python3.8 /path/to/your/bot_script.py

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.