diff options
| author | ilotterytea <iltsu@alright.party> | 2024-12-14 00:14:51 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-12-14 00:14:51 +0500 |
| commit | cb24d0b3fec4c983320162dd0e080fc05709ae55 (patch) | |
| tree | be096bfc8b94320901a83e5150ad51eee918ad33 /bot/src/handlers.cpp | |
| parent | dbb795b2c851e23d7af2de3983138dcd66d6104c (diff) | |
upd: markov response chance
Diffstat (limited to 'bot/src/handlers.cpp')
| -rw-r--r-- | bot/src/handlers.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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 = |
