This commit reduces the repetitions in the tests when we create new
messages. It hardcodes a bunch of fields that are currently not used,
but might be eventually.
There was a bug in the parsing logic that caused a substitution
command like `s/typo/correction` to crash the bot.
Correct command is of course `s/typo/correction/`, but now it at least
shouldn't crash.
There was a bug in how we parsed admin commands, apparently we never
tested if we could parse `!backlog X` or unknown admin commands.
This commit also make updates to the backlog command construction to
make sure that we don't try to access messages in the backlog that
don't exist.
This commit creates a bunch of new modules that contain code and tests
for various concepts/implementations that used to exist inside
bot.zig.
Notable amongst these are:
- buffer.zig, which contain the circular buffer containing both
backlog and outbox messages.
- parser.zig, which contain the parser used to parse commands from IRC
messages.
This commit introduces a Bot struct which is the main type of this
project. The Bot holds a backlog of messages to be able to update a
typo in a message and so on.
So far there is no IRC/TLS implementation, it is only the base logic.