This is a simple Telegram bot that echoes back any message sent to it. It also responds to /start
and /hello
commands with a welcome message.
.
├── .env # Environment variables file
├── .env.sample # Sample environment variables file
├── .git # Git repository directory
├── .gitignore # Git ignore file
├── .venv # Virtual environment directory
├── bot.py # Bot script
├── requirements.txt # Python dependencies
└── README.md # Project documentation
- Python 3.6 or higher
pip
(Python package installer)
-
Clone the repository (if applicable)
git clone <repository-url> cd <repository-directory>
-
Create and activate a virtual environment
python -m venv .venv # On Windows .venv\Scripts\activate # On Unix or MacOS source .venv/bin/activate
-
Install the required packages
pip install -r requirements.txt
-
Set up the environment variables
Create a
.env
file in the project directory with the following content (replaceyour_bot_token
with your actual bot token):BOT_TOKEN=your_bot_token
You can use the
.env.sample
file as a template. -
Run the bot
python bot.py
- Send
/start
or/hello
command to the bot to receive a welcome message. - Send any other message and the bot will echo it back to you.
- .env: Contains the environment variables for the bot.
- .env.sample: A sample environment variables file for reference.
- .git: Directory containing Git repository data.
- .gitignore: Specifies files and directories to be ignored by Git.
- .venv: The virtual environment directory.
- bot.py: The main bot script.
- requirements.txt: Lists the Python packages required to run the bot.
- README.md: Project documentation.
This project is licensed under the MIT License.