Collect messages from discord channel to log statistics on daily puzzles games, e.g. Wordle.
The games currently supported are:
- Mini crossword (see notes below)
- Wordle
- Nerdle
- Mini Nerdle
- Micro Nerdle
- Instant Nerdle
- Quordle
- Sequence Quordle
- Octordle
- Sequence Octordle
- Flagle
- Flagle.io
- Worldle
- Angle
- Countryle
- Capitale
More games might be added in the future.
Mini crossword does not have a useable share-function. To correctly parse Mini crossword, results (the time spent solving) must be manually written to discord channel on the form:
Mini1: 1m23s
Code is tested with Python version 3.11.2
. A python installation later than 3.8
is required, but not guaranteed to be stable.
Required modules:
numpy
>1.24.2
pandas
>1.5.3
requests
>2.31.0
It is always good practice to run the code in a virtual environment. With your venv active, run
$ pip install -r requirements.txt
to install the necessary dependencies.
Below follows a rough guide on how to use the included functionality.
Firstly, clone the repository. Make sure to use the most recent stable release (use dev branches at your own risk!).
-
The result text for each game (e.g. from share button) should be posted in your favorite discord channel. See notes below on some caveats.
-
Collect authentication token and channel id for your discord channel of choice.
-
Save token and channel id in a local file
tokens.txt
on a path accessible to the python module (such as the root directory of the repository). -
The
message_parser
module can be imported in a python environment of your choice, such as- Regular python script
- Jupyter notebook
- The python environment for your own discord bot
by running the import statement
import message_parser as MP
-
Use the internal functions, such as
MP.collect_data()
orMP.update_df()
to get a pandas dataframe with your game data. -
Some additional functionality and utilities can be found in
util.py
, such as numerical parsing of scores. Refer to docstrings in the scripts for more info.
It is recommended to have a dedicated text-channel for posting scores. While the parser will handle (most) other messages fine, they will add extra time to the query process, and might clutter the final dataset with unneccesary messages. In particular, do avoid posting messages where the first word corresponds to the individual game-keywords, as this might cause errors (particularly in the case of Quordle, whose identifier is the word "Daily").
Project is licensed under the MIT License. See LICENSE.md for more info.