Skip to content

Commit

Permalink
Update DiscordAccountCheck.php
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaMicallefYBSU committed Oct 25, 2024
1 parent 8319163 commit 2b31807
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/Jobs/DiscordAccountCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ public function handle()
$rolesToRemove = array_diff($discord_member['roles'], $combinedRoles);

if (!empty($rolesToAssign) || !empty($rolesToRemove) || $name !== $discord_member['nick']) {

// Sleep for 1 second (let API catch up)
sleep(1);

$message = "Assign Roles:";
foreach($rolesToAssign as $role){
$message .= "\n- $role";
Expand All @@ -281,6 +285,8 @@ public function handle()
]);

foreach ($staffRoles as $role){

// Slow down multi role add. Allow API to catch up
sleep(0.75);

// add role
Expand Down Expand Up @@ -316,7 +322,7 @@ public function handle()

$accounts_not_linked++; //records that Account Not Linked Role Assigned

sleep(0.75);
sleep(1);

// // Update user with main roles - Will temp remove staff roles
$discord->getClient()->patch('guilds/'.env('DISCORD_GUILD_ID').'/members/'.$user->discord_user_id, [
Expand Down

0 comments on commit 2b31807

Please sign in to comment.