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.
Ensure the following are installed or available before setting up the bot:
- Python 3.8 or 10 installed
- Telegram account
- PythonAnywhere account
-
Clone Repository:
git clonehttps://github.com/ktwillcode/Telegram-Bot--Botty.git cd Telegram-Bot--Botty
-
Install Dependencies:
pip install python-telegram-bot
-
Create a Bot via BotFather:
- Open Telegram and search for BotFather.
- Follow the steps to create a new bot and obtain the API token.
-
Configure the Bot:
- Open the
botty.py
file. - Replace
'YOUR_API_TOKEN'
with the obtained API token.
- Open the
-
Run the Bot:
python your_bot_script.py
-
Interacting with the Bot:
- Open Telegram and search for your bot by its username.
- Start interacting with the bot by sending messages or commands.
-
Upload the Bot Script:
- Upload the bot script (
botty.py
) to PythonAnywhere.
- Upload the bot script (
-
Install Dependencies on PythonAnywhere:
- Open a Bash console on PythonAnywhere.
- Install the
python-telegram-bot
library:
pip3.8 install --user python-telegram-bot
-
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
Contributions are welcome! Feel free to open issues or submit pull requests.