Phew, this is a big file. In its current state, it's really just a massive if-else block with little organization. There are places where similar logic/functionality is repeated.
My goals for this rewrite are:
Maintain all existing functionality; changes should be largely transparent to users.
Re-organize code into smaller individual functions for each command. The file should be easier to read and navigate. It should be easy and obvious for future contributions to add commands and leverage shared functionality.
Splitting up the code also opens up opportunities to introduce tests for individual commands. Try to do so where it makes sense, but it's not going to be a major focus of this PR. I'm planning on introducing Jest as a dev-dependency for this purpose.
Progress:
[x] listacc
[x] addacc
[x] delacc
[x] addnp
[x] delnp
[x] delay commands
[x] cd commands
[x] toggleself
[x] toggleemotes
[x] id
[x] addmod
[x] delmod
[x] addglobalnp
[x] delglobalnp
[x] join
[x] part
[ ] emotes commands <--- I might spend some time rethinking this syntax, IDK right now.
I'm keeping the commits separate for now, but I'll squash them in the end.
Bonus
Closes #14
Known issues (FIXME)
~cd command doesn't seem to be responding when invalid value is entered~ fixed
Phew, this is a big file. In its current state, it's really just a massive
if-else
block with little organization. There are places where similar logic/functionality is repeated.My goals for this rewrite are:
Progress:
I'm keeping the commits separate for now, but I'll squash them in the end.
Bonus
Closes #14
Known issues (FIXME)
cd
command doesn't seem to be responding when invalid value is entered~ fixed