Made each module export only a list of receivers (Intent system that @9nine9nine9 described) so it is easily extensible and future-proof
Adding a new command in an existing module only requires a change in that module
Creating new modules requires you to register the module in EventHandler and the cabal file as before
Abstracted away DiscordHandler (Either RestCallErrorCode Message) to a cleaner DiscordHandler () since the returned Message isn't used anyway
Gave all receivers a consistent type signature (Message -> DiscordHandler (), or ReactionInfo -> DiscordHandler ())
Use T.Text for all possible places apart from when interacting with functions that require String (e.g. disk IO), and Main
Added new Util methods to create commands: newCommand and newDevCommand. This abstracts away RegEx matching and subgroup capturing as well as dev checking
This also puts all the RegEx into the receiver module itself, so all RE files (apart from TemplateRE) has been removed
Formatted the entire codebase: aligned imports, comma-broken lists (diff becomes cleaner), and ~80 char wraps
Made code structure somewhat consistent throughout the codebase, so new additions can easily reference styles from wherever it wants
Renamed several functions to be more representative of what they're responsible
Removed any legacy unused code
Updated README with more information, added a Dockerfile (untested) for better deployment
Fixed several issues that were open
Created a Parsec parser for CSV files, and delegated all CSV work into there (includes unit tests)
IMPORTANT: Changed location of csv storage from src/config/~~.conf to .owen/~~.csv.
IMPORTANT: All .csv files now require a new line at the end
IMPORTANT: fame.csv and devs.csv are now ONE ITEM PER LINE, instead of a comma separated single line
Unchanged
Nothing...
Requesting some local testing or review before actually merging, because although I tested on my machine, most of the code is newly written and therefore prone to mistakes/errors. (...or we can just merge and test in production lmao)
Changed
DiscordHandler (Either RestCallErrorCode Message)
to a cleanerDiscordHandler ()
since the returnedMessage
isn't used anywayMessage -> DiscordHandler ()
, orReactionInfo -> DiscordHandler ()
)newCommand
andnewDevCommand
. This abstracts away RegEx matching and subgroup capturing as well as dev checkingsrc/config/~~.conf
to.owen/~~.csv
..csv
files now require a new line at the endfame.csv
anddevs.csv
are now ONE ITEM PER LINE, instead of a comma separated single lineUnchanged
Requesting some local testing or review before actually merging, because although I tested on my machine, most of the code is newly written and therefore prone to mistakes/errors. (...or we can just merge and test in production lmao)