15 return Reply{
Text(key, std::move(tokens))};
21 return std::unexpected(
32 if (
Send && !line.empty())
34 Send(std::string(line));
@ Failed
Anything else; the default so a value-initialized Error is never a false success.
std::expected< T, Error > Result
std::map< std::string, std::string > Tokens
void SayRaw(std::string_view line) const
Result< Reply > Ok(std::string_view key, Tokens tokens={}) const
std::function< void(const std::string &)> Send
VoltMod::Translations & Translations
std::string Text(std::string_view key, Tokens tokens={}) const
Result< Reply > Fail(std::string_view key, Tokens tokens={}) const
void Say(std::string_view key, Tokens tokens={}) const
One failure: a code to branch on, text for the log, and an optional translation key.
What a command handler answers with.