From f0de7ea2551bed751c686c71a1d1c512fe9de142 Mon Sep 17 00:00:00 2001 From: Finnbar Keating Date: Fri, 28 Jan 2022 09:21:45 +0000 Subject: [PATCH] Tiny fix for #109 For .sayblah, chunk was correctly consuming "say", but then we got an unknown error when it tried to consume spaces --- src/Tablebot/Internal/Handler/Command.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Tablebot/Internal/Handler/Command.hs b/src/Tablebot/Internal/Handler/Command.hs index 9f2dabd4..910bb46e 100644 --- a/src/Tablebot/Internal/Handler/Command.hs +++ b/src/Tablebot/Internal/Handler/Command.hs @@ -90,8 +90,7 @@ parseCommands cs m prefix = case parse (parser cs) "" (messageText m) of Nothing -> Just <$> command matchCommand :: CompiledCommand -> Parser (Maybe (Parser (Message -> CompiledDatabaseDiscord ()), [CompiledCommand])) matchCommand c = do - _ <- chunk (commandName c) - skipSpace1 <|> eof + try (chunk (commandName c) *> (skipSpace1 <|> eof)) return (Just (commandParser c, commandSubcommands c)) data ReadableError = UnknownError | KnownError String [String]