diff options
Diffstat (limited to 'bot')
| -rw-r--r-- | bot/src/constants.hpp | 2 | ||||
| -rw-r--r-- | bot/src/handlers.cpp | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/bot/src/constants.hpp b/bot/src/constants.hpp index 3c3462b..b72a4c6 100644 --- a/bot/src/constants.hpp +++ b/bot/src/constants.hpp @@ -11,3 +11,5 @@ const std::string DEFAULT_PREFIX = "~"; const std::string DEFAULT_PREFIX = "!"; #endif const auto START_TIME = std::chrono::steady_clock::now(); + +#define MARKOV_RESPONSE_CHANCE 1
\ No newline at end of file diff --git a/bot/src/handlers.cpp b/bot/src/handlers.cpp index c57edad..7589e0b 100644 --- a/bot/src/handlers.cpp +++ b/bot/src/handlers.cpp @@ -12,6 +12,7 @@ #include "commands/command.hpp" #include "commands/request.hpp" #include "commands/request_util.hpp" +#include "constants.hpp" #include "cpr/api.h" #include "cpr/multipart.h" #include "cpr/response.h" @@ -125,10 +126,10 @@ namespace bot::handlers { std::random_device dev; std::mt19937 rng(dev()); - std::uniform_int_distribution<std::mt19937::result_type> dist(0, 10); + std::uniform_int_distribution<std::mt19937::result_type> dist(0, 100); random = dist(rng); - if (random != 0) return; + if (random > MARKOV_RESPONSE_CHANCE) return; question = message.message; } else { question = |
