Telegram: @cpgame_bot
After the Corona Prediction Game had been online for about 1.5 years and users had made more than 400 predictions, I decided to shut it down in May 2022. It turned out that the code didn't scale well with so many users. Feel free to reuse what you need, but note that I wasn't an overly experienced programmer when I developed this bot.
Users of this bot can predict the Covid-19 statistics by drawing a graph into a diagram. Afterwards, the number of cases is compared with the prediction and for every predicted day, up to 1 point can be scored.
This bot is using a dataset maintained by 'Our World in Data'. You can find it here. The original data is provided by the European Centre for Disease Prevention and Control (EDCD). For more information on their copyright policy, check out this link.
Due to the use of the library multiprocessing
errors might occur when running on Windows. I did not test it though.
- Install the dependencies:
pip install -r requirements.txt
- Create a new Telegram bot using @BotFather
- Insert the bot token at internals.py
- Run the script:
python main.py
- scores_update: datetime.datetime
- users: dict
- (user id): int
- chart_scale: float
- drawing_area: tuple
- drawing_update: datetime.date
- high_scores_view: str
- last_conversation_state: int
- last_scheduled_update: datetime.datetime
- last_update: int
- limits_note: bool
- nickname: str
- nickname_confirmed: False
- predictions: dict
- recent_prediction: dict
- recent_country: str
- scheduled_updates_interval: None
- scores: dict
- scores_daily: dict
- scores_persistent: dict
- persistency_notification_sent: list
- (country name): str
- update_notifications: bool
- (user id): int
- high_scores: list
- high_scores_daily: list
- high_scores_yesterday: list
- groups: dict
- (chat id):int
- configurations: dict
- (config ids): int
- bets: dict
- country: str
- duration: datetime.timedelta
- submissions: str
- user: int
- (config ids): int
- configurations: dict
- (chat id):int
- challenges: dict
- (challenge id): int
- bets: dict
- chat_id: int
- country: str
- duration: datetime.timedelta
- end: datetime.date
- id: int
- message_id: int
- submissions: str
- submission_end: datetime.datetime
- user: int
- (challenge id): int
- action: str
- challenge_active: bool
- challenge_id: int
- chat_id: int
- config_id: int