This is a fun trivia bot that asks multiple-choice questions and tracks the user's score. At the end, it reveals a hidden message and asks "Will you be my Valentine?"
This bot was developed by Raymond Harrison for a special Valentine's Day event. Please support me by following me on 🥰:
The bot supports:
✅ Multiple-choice questions with buttons
✅ Interactive scoring system
✅ Final reveal with Valentine's details
To create your bot, follow these steps:
- Open Telegram and search for
@BotFather. - Start a chat and type:
/newbot - Follow the prompts:
- Choose a bot name (e.g.,
TriviaQuestBot). - Choose a unique username (must end in
bot, e.g.,TriviaValentineBot).
- Choose a bot name (e.g.,
BotFatherwill provide you with a bot token (a long string of characters). Save this token as you'll need it later.
Ensure Python is installed, then install the required dependencies:
pip install pyTelegramBotAPI python-dotenvTo keep your token secure, create a .env file in the bot directory:
-
Create a
.envfile in your bot's directory. -
Add your bot token to the file:
TOKEN=your_bot_token_herereplace
your_bot_token_herewith the token you obtained fromBotFather. -
Save the file.
In the bot.py file, locate the following line:
if call.data == "yes":
bot.send_message(chat_id, f"💖 It's a date! 🎉\n\n**Details:**\n📅 Date: 14 Feb\n🕕 Time: Evening\n📍 Location: Chinese Garden\n👗 Dress Code: Picnic 🧺")Replace the date and time details with your Valentine's Day plans.
Start the bot by running:
python bot.pyOnce running, search for your bot on Telegram and type /start to begin the game!
Hire me for your next project! Contact Me