summaryrefslogtreecommitdiff
path: root/src/commands/request_util.cpp
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2024-05-16 21:58:52 +0500
committerilotterytea <iltsu@alright.party>2024-05-16 21:58:52 +0500
commit4ebfa4f82679b5edafca70b2da1646d5d1b2decc (patch)
treea7fb2a89954cb23a712816d491b2a3163668ffcd /src/commands/request_util.cpp
parent49e41eaff5c219e4e8452188f19974bf019c33e4 (diff)
upd: send nothing if the channel is opted out
Diffstat (limited to 'src/commands/request_util.cpp')
-rw-r--r--src/commands/request_util.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/commands/request_util.cpp b/src/commands/request_util.cpp
index 3d44054..90750e5 100644
--- a/src/commands/request_util.cpp
+++ b/src/commands/request_util.cpp
@@ -65,6 +65,11 @@ namespace bot::command {
schemas::Channel channel(query[0]);
+ if (channel.get_opted_out_at().has_value()) {
+ delete work;
+ return std::nullopt;
+ }
+
query = work->exec("SELECT * FROM channel_preferences WHERE channel_id = " +
std::to_string(channel.get_id()));