mirror of
https://github.com/Syping/dtranslatebot.git
synced 2024-12-22 03:45:35 +01:00
message_queue: combine if condition
This commit is contained in:
parent
ea2c6c460f
commit
46b80f3bdf
1 changed files with 1 additions and 5 deletions
|
@ -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<bot::settings::settings> guard(*settings);
|
||||
if (const bot::settings::channel *channel = settings->get_channel(event.msg.guild_id, event.msg.channel_id)) {
|
||||
bot::message message;
|
||||
|
|
Loading…
Reference in a new issue