opt-natter / discord-mybb-sync

A MyBB Plugin to syncronise MyBB Groups with Discord Roles
MIT License
11 stars 3 forks source link

Fix for "Not all roles synced. Discord API limit reached." #20

Closed TerranUlm closed 3 years ago

TerranUlm commented 3 years ago
  1. Go to https://discordapp.com/developers/applications/me#top
  2. Select the app for the sync
  3. Select the "Bot" menu
  4. Scroll down to "SERVER MEMBERS INTENT" and enable that option

done

familypet commented 3 years ago

MVP

TerranUlm commented 3 years ago

Another fix: replace all "X-RateLimit-..." strings to lowercase.

familypet commented 3 years ago

https://github.com/opt-natter/discord-mybb-sync/blob/9496d926f0ca860526578a7c41ad0dff94bb5ded/inc/plugins/discord_right_sync.php#L538

So from line 538, would look like this?

if (isset($response->headers['x-ratelimit-reset'])) //update reset time
        {
            $db->update_query("settings", array(
                'value' => (int)$response->headers['x-ratelimit-reset']
            ) , "name = 'drs_setting_ratelimit_reset'");
        }
        if ($response->headers['x-ratelimit-remaining'] == 0) //no more Querries allowed
        {
            return false;
        }
    }
}
return true;

}

TerranUlm commented 3 years ago

yes

opt-natter commented 3 years ago

Hi Terran,

are you sure about the lowecase? https://discord.com/developers/docs/topics/rate-limits

TerranUlm commented 3 years ago

Hi Natter,

Yes, the header returned in $response is all lower case. Might be due to the library for the rest calls. Since I'd changed it the timestamp is updated again.

opt-natter commented 3 years ago

Fixed in version 0.7.1