(ixbots) add new class to configure a bot to simplify passing options around

This commit is contained in:
Benjamin Sergeant
2020-05-12 19:08:16 -07:00
parent cc72494b63
commit 2e904801a0
18 changed files with 109 additions and 188 deletions

View File

@@ -16,15 +16,9 @@
namespace ix
{
int64_t cobra_to_sentry_bot(const CobraConfig& config,
const std::string& channel,
const std::string& filter,
const std::string& position,
int64_t cobra_to_sentry_bot(const CobraBotConfig& config,
SentryClient& sentryClient,
bool verbose,
bool enableHeartbeat,
int heartBeatTimeout,
int runtime)
bool verbose)
{
CobraBot bot;
bot.setOnBotMessageCallback([&sentryClient, &verbose](const Json::Value& msg,
@@ -77,12 +71,6 @@ namespace ix
});
});
return bot.run(config,
channel,
filter,
position,
enableHeartbeat,
heartBeatTimeout,
runtime);
return bot.run(config);
}
} // namespace ix