🪐 Telegram bot that sends the horoscope for the day on request: it generates a forecast by combining four pieces of sentences. 🪐
- Python
- pytelegrambotapi
You start the bot with the /start command, the bot asks you whether you want today's horoscope, you should send давай, and choose your zodiac sign from the selection. The bot will then generate a random forecast and send it to you.
The horoscope_generator/handlers.py uses the TOKEN variable - this is your bot's token, you can get it from the @BotFather bot right after your bot's registration. Keep it in a separate location.
To deploy your own horoscope bot:
- Clone the repository
- Create a virtual environment in your project's directory
- Run the virtual environment and install the requirements
- Create an .env file in the horoscope_generator directory
- Register a new Telegram bot using @BotFather
- Save your bot's token to the .env file
- Run the bot
Run the following script in bash
git clone https://github.com/AnnaBaziruwiha/good_morning_bot.git
Move to the project's directory good_morning_bot, and run the script
python3 -m venv venv
Run the virtual environment
source ./venv/scripts/activate # для windows
source ./venv/bin/activate # для linux
Install the requirements
(venv)
pip install -r requirements.txt
Run the following script in the project's directory
python3 main.py
If you delploy your bot like that, it will only work while your computer is on and this script is running. If you need it to always be running, you can deploy it on a server.
Check out more of my projects here
You can send requests and suggestions to this address
My linkedin