From 18742d79e1de863889521c492e938491489316fe Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 3 Feb 2017 13:56:19 -0500 Subject: Created bot --- main.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 main.cpp (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..3661105 --- /dev/null +++ b/main.cpp @@ -0,0 +1,33 @@ +#include "advice.h" + +int main(int argc, char** argv) +{ + Magick::InitializeMagick(nullptr); + + std::random_device random_device; + std::mt19937 random_engine{random_device()}; + + if (argc != 2) + { + std::cout << "usage: advice [configfile]" << std::endl; + return -1; + } + + std::string configfile(argv[1]); + + try + { + advice bot(configfile, random_engine); + + try + { + bot.run(); + } catch (const std::exception& ex) + { + std::cout << "Error running bot: " << ex.what() << std::endl; + } + } catch (const std::exception& ex) + { + std::cout << "Error initializing bot: " << ex.what() << std::endl; + } +} -- cgit 1.4.1