diff options
| author | ilotterytea <iltsu@alright.party> | 2025-07-02 03:34:44 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-07-02 03:34:44 +0500 |
| commit | 04fb4e18f8cddd3d963824c6d396b960c7164dc5 (patch) | |
| tree | 1d2494cdd70523731b1a2a7e9f79703c2eea1555 | |
| parent | 2ca9b42d1a352e7a3b1d933bf0f424ef9ab705d2 (diff) | |
feat: ignore messages if channel has silent_mode feature
| -rw-r--r-- | bot/src/commands/request.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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; } |
