From 4ebfa4f82679b5edafca70b2da1646d5d1b2decc Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Thu, 16 May 2024 21:58:52 +0500 Subject: upd: send nothing if the channel is opted out --- src/timer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/timer.cpp') diff --git a/src/timer.cpp b/src/timer.cpp index ccdf176..055dde0 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -38,11 +38,11 @@ namespace bot { now - last_executed_at); if (difference.count() > interval_sec) { - pqxx::result channels = - work->exec("SELECT alias_name FROM channels WHERE id = " + - std::to_string(channel_id)); + pqxx::result channels = work->exec( + "SELECT alias_name, opted_out_at FROM channels WHERE id = " + + std::to_string(channel_id)); - if (!channels.empty()) { + if (!channels.empty() && channels[0][1].is_null()) { std::string alias_name = channels[0][0].as(); irc_client->say(alias_name, message); -- cgit v1.2.3