From 16917aa09c84fb0d6e505f7bb8bf956fe6bfa981 Mon Sep 17 00:00:00 2001 From: Archie Jaskowicz Date: Thu, 13 Jun 2024 09:39:06 +0100 Subject: [PATCH] feat: added warnings for certain events that require an intent --- src/dpp/cluster.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/dpp/cluster.cpp b/src/dpp/cluster.cpp index db8ce14c31..0bad50e268 100644 --- a/src/dpp/cluster.cpp +++ b/src/dpp/cluster.cpp @@ -171,6 +171,22 @@ void cluster::start(bool return_after) { this->terminating.wait(thread_lock); }; + if (on_guild_member_add && !(intents & dpp::i_guild_members)) { + log(ll_warning, "You have attached an event to cluster::on_guild_member_add() but have not specified the privileged intent dpp::i_guild_members. This event will not fire."); + } + + if (on_guild_member_remove && !(intents & dpp::i_guild_members)) { + log(ll_warning, "You have attached an event to cluster::on_guild_member_remove() but have not specified the privileged intent dpp::i_guild_members. This event will not fire."); + } + + if (on_guild_member_update && !(intents & dpp::i_guild_members)) { + log(ll_warning, "You have attached an event to cluster::on_guild_member_update() but have not specified the privileged intent dpp::i_guild_members. This event will not fire."); + } + + if (on_presence_update && !(intents & dpp::i_guild_presences)) { + log(ll_warning, "You have attached an event to cluster::on_presence_update() but have not specified the privileged intent dpp::i_guild_presences. This event will not fire."); + } + /* Start up all shards */ gateway g; try {