Commit Graph

13 Commits

Author SHA1 Message Date
projectmoon 06ff6562c1 Add more tests for handling weird input. 2020-09-01 08:17:59 +00:00
projectmoon f3f5846826 Fix command parser returning non-commands/empty messages as errors.
This behavior became broken again after switching away from the
macro-based command parsing. The bot would return any non !command
message as an error, which would cause it to read more messages, and
return those as errors, until finally the matrix SDK would throw up.

Command parser now more properly handles empty messages and
non-commands, but we also simply abort processing if the incoming
message doesn't start with an exclamation point.
2020-08-31 23:33:46 +00:00
projectmoon 8803b83ddb Remove useless trim function and unnecessary uses of eat_whitespace. 2020-08-31 20:16:43 +00:00
projectmoon da0819745a Switch to non-macro nom parser with better text handling.
By using the alpha1 function in complete mode, we are able to handle
arbitrary single-word commands (e.g. "!help") and proprly map the
remaining input to an empty string.
2020-08-31 00:07:56 +00:00
projectmoon 531844fbb7 Implement basic, not-well-formatted help. 2020-08-30 21:54:01 +00:00
projectmoon 2c08eb41ad Implement Chronicles of Darkness dice system, improve error handling.
Adds the Chronicles of Darkness 2E dice system to the bot, and also
somewhat improves the error handling when weird commands are received.
2020-08-23 21:24:04 +00:00
Taylor C. Richberger 4e72498181 format 2020-04-21 00:15:18 -06:00
Taylor C. Richberger 1a34a390d4 cargo fix again 2020-04-21 00:11:52 -06:00
Taylor C. Richberger 319e016bc3 remove unneeded 2020-04-21 00:11:25 -06:00
Taylor C. Richberger e7458c12ad cargo fix and fmt 2020-04-21 00:09:43 -06:00
Taylor C. Richberger 198f0bd43f remove unnecessary annotation 2020-04-21 00:08:29 -06:00
Taylor C. Richberger 649aec531e implement command parser fully 2020-04-21 00:07:03 -06:00
Taylor C. Richberger 90ae9c142c lay command groundwork. Maybe need to make parsing more ergonomic. 2020-04-20 21:15:13 -06:00