A WhatsApp bot that sends reminders for upcoming Codeforces contests.
- Install the required dependencies:
pip install -r requirements.txt- Create a
.envfile in the project root with your Twilio credentials:
TWILIO_ACCOUNT_SID=your_account_sid
TWILIO_AUTH_TOKEN=your_auth_token
TWILIO_PHONE_NUMBER=your_twilio_whatsapp_number
-
Set up a Twilio account:
- Sign up at Twilio
- Get your Account SID and Auth Token
- Set up a WhatsApp sandbox following Twilio's WhatsApp setup guide
-
Run the bot:
python cf_bot.py- To test the bot:
- Send a WhatsApp message to your Twilio WhatsApp number
- Send "contest" or "upcoming" to get information about upcoming contests
- The bot will respond with details of contests happening in the next 24 hours
- Fetches upcoming Codeforces contests
- Shows contest details including:
- Contest name
- Time until start
- Contest duration
- Registration link
- Only shows contests within 24 hours
- Simple WhatsApp interface
This bot uses the Twilio sandbox environment, which requires you to send a specific message to join the sandbox. Follow Twilio's instructions to set this up properly.