From 46b80f3bdf1197e5910a843b1c71c848f93de380 Mon Sep 17 00:00:00 2001 From: Syping Date: Fri, 23 Feb 2024 11:27:17 +0100 Subject: [PATCH] message_queue: combine if condition --- src/message_queue.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/message_queue.cpp b/src/message_queue.cpp index 007f207..fffb71a 100644 --- a/src/message_queue.cpp +++ b/src/message_queue.cpp @@ -37,7 +37,7 @@ void message_queue::add(message &&message) void message_queue::process_message_event(dpp::cluster *bot, bot::settings::settings *settings, const dpp::message_create_t &event) { // We check for conditions we want to skip translation for - if (event.msg.content.empty() || event.msg.has_thread()) + if (event.msg.author.id == bot->me.id || event.msg.content.empty() || event.msg.has_thread()) return; if (event.msg.webhook_id) { @@ -48,10 +48,6 @@ void message_queue::process_message_event(dpp::cluster *bot, bot::settings::sett return; } - // Same as before, just without the involvement of webhooks - if (event.msg.author.id == bot->me.id) - return; - const std::lock_guard guard(*settings); if (const bot::settings::channel *channel = settings->get_channel(event.msg.guild_id, event.msg.channel_id)) { bot::message message;