Skip to content

Commit

Permalink
feat: added warnings for certain events that require an intent (#1169)
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis authored Jul 3, 2024
2 parents 859eb74 + 16917aa commit ec55d78
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 ec55d78

Please sign in to comment.