From e23ccfb00c8fa39926b32e94be6bc379e70ba11d Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Thu, 3 Jul 2025 18:05:11 +0500 Subject: feat: separated requester from request --- bot/src/localization/localization.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bot/src/localization') diff --git a/bot/src/localization/localization.cpp b/bot/src/localization/localization.cpp index b8659ea..fe7a02a 100644 --- a/bot/src/localization/localization.cpp +++ b/bot/src/localization/localization.cpp @@ -105,7 +105,7 @@ namespace bot { const command::Request &request, const LineId &line_id, const std::vector &args) const { std::optional o_line = this->get_formatted_line( - request.channel_preferences.get_locale(), line_id, args); + request.requester.channel_preferences.get_locale(), line_id, args); if (!o_line.has_value()) { return std::nullopt; @@ -114,10 +114,11 @@ namespace bot { std::string line = o_line.value(); std::map token_map = { - {"{sender.alias_name}", request.user.get_alias_name()}, - {"{source.alias_name}", request.channel.get_alias_name()}, + {"{sender.alias_name}", request.requester.user.get_alias_name()}, + {"{source.alias_name}", request.requester.channel.get_alias_name()}, {"{default.prefix}", DEFAULT_PREFIX}, - {"{channel.prefix}", request.channel_preferences.get_prefix()}}; + {"{channel.prefix}", + request.requester.channel_preferences.get_prefix()}}; for (const auto &pair : token_map) { int pos = line.find(pair.first); -- cgit v1.2.3