From 04fb4e18f8cddd3d963824c6d396b960c7164dc5 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Wed, 2 Jul 2025 03:34:44 +0500 Subject: feat: ignore messages if channel has silent_mode feature --- bot/src/commands/request.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bot/src/commands/request.cpp') diff --git a/bot/src/commands/request.cpp b/bot/src/commands/request.cpp index d7f1f83..434c222 100644 --- a/bot/src/commands/request.cpp +++ b/bot/src/commands/request.cpp @@ -150,7 +150,11 @@ namespace bot::command { std::string fullmsg = irc_message.message; const std::string &prefix = pref.get_prefix(); - if (fullmsg.empty() || fullmsg.substr(0, prefix.length()) != prefix) { + if (fullmsg.empty() || fullmsg.substr(0, prefix.length()) != prefix || + std::any_of(pref.get_features().begin(), pref.get_features().end(), + [](const schemas::ChannelFeature &f) { + return f == schemas::ChannelFeature::SILENT_MODE; + })) { return std::nullopt; } -- cgit v1.2.3