Skip to content

Commit

Permalink
feat: added warnings for certain events that require an intent
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaskowicz1 committed Jun 13, 2024
1 parent c36b5de commit 16917aa
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/dpp/cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 16917aa

Please sign in to comment.