From b96792078a350b02c6d3e650bbe5c42b665bee7e Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 14 Dec 2024 23:11:49 +0500 Subject: feat: a method for converting strings to ChannelFeature --- bot/src/schemas/channel.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 bot/src/schemas/channel.cpp (limited to 'bot/src/schemas/channel.cpp') diff --git a/bot/src/schemas/channel.cpp b/bot/src/schemas/channel.cpp new file mode 100644 index 0000000..ae4ea53 --- /dev/null +++ b/bot/src/schemas/channel.cpp @@ -0,0 +1,14 @@ +#include "channel.hpp" + +namespace bot::schemas { + std::optional string_to_channel_feature( + const std::string &value) { + if (value == "markov_responses") { + return MARKOV_RESPONSES; + } else if (value == "random_markov_responses") { + return RANDOM_MARKOV_RESPONSES; + } else { + return std::nullopt; + } + } +} \ No newline at end of file -- cgit v1.2.3