No idea if you're open to pull requests, but my group plays Wordle, Subwaydle, Worldle, and one guy plays Taylordle (the Taylor Swift one), so I refactored a bunch of stuff to make this work for all of them:
- The db class now takes the game abbreviation (
wb
, wlb
, sb
, or tb
) as a method parameter and matches up the Mongo db based on that.
- The
on_message
function has been refactored to catch the game type being requested and pass the abbreviation, full name, and customized regex (because Subwaydle puts # chars before the name and game number).
- I also tightened up some of the stats output, added emoji and bolding to names and stat values, and added a
--test
command line parameter so I could test this alongside a running instance in a separate Discord channel.
- Also, I added some installation steps to the readme, because who knows how long it'll take Discord to approve your public service?! Could be ages, for all we know, right?
A bunch of this could probably be cleaner, but I don't actually know Python. This is my first attempt at using it, but it's similar enough to everything else, I guess. One could probably put all the games in one DB and use different collections instead, but the main one was already called "wordle", and I didn't want to break anyone's existing database arrangement. I didn't know what to do with !wb members
since it never worked for me on my 80 person server because the results were too large for one message and Discord threw an error. I think I just removed it altogether.
Anyway, let me know what you think!