Gamebuster19901 / Roll

3 stars 0 forks source link

Bump net.dv8tion:JDA from 5.0.0-beta.6 to 5.0.0-beta.7 #39

Closed dependabot[bot] closed 1 year ago

dependabot[bot] commented 1 year ago

Bumps net.dv8tion:JDA from 5.0.0-beta.6 to 5.0.0-beta.7.

Release notes

Sourced from net.dv8tion:JDA's releases.

v5.0.0-beta.7 | Customize Rate-Limiter

Overview

You can now use RestConfig to customize parts of the REST handling in JDA. This allows you to create custom rate-limiter implementations and make use of rate-limit proxy services such as http-proxy.

Rate-Limiter Customization (#2307)

Using RestConfig, you can change parts of the REST handling. This allows you to append to the User-Agent, add custom headers, or even completely replace the existing Rate-Limiter handling:

RestConfig config = new RestConfig();
config.setUserAgentSuffix("custom suffix"); // Changes user-agent to "DiscordBot(JDA, ...) custom suffix"
config.setBaseUrl("https://proxy.example.com/api/v10"); // requests will now go through this endpoint, allowing custom rate-limits
config.setRateLimiterFactory(...); // change the handling of rate-limits

builder.setRestConfig(config); // then simply set it on your JDABuilder or DefaultShardManagerBuilder

This can also be useful to implement a different queue system for rate-limit handling. By default, JDA will always use the SequentialRateLimiter, which handles requests to the same rate-limit bucket in sequence to avoid messages being unordered. A custom implementation could replace this to run requests in parallel.

To implement a custom rate-limiter, use the existing RestRateLimiter interface and implement the required methods as documented. Your implementation will be provided with Work instances to handle.

Member Flags (#2417)

You can now access the flags on members and modify them. This allows to check if a member has rejoined the guild or passed onboarding. The rejoin flag is not entirely reliable, since Discord has only started tracking rejoins recently. Members who rejoined years ago will not have this flag set.

With Member#modifyFlags, you can change some of these flags. Only a subset of the existing flags are modifiable.

EnumSet<MemberFlag> flags = member.getFlags();
flags.add(MemberFlag.BYPASS_VERIFICATION); // Member bypasses verification level on guild
member.modifyFlags(flags).queue();

Features

Changes

Bug Fixes

Full Changelog: https://github.com/DV8FromTheWorld/JDA/compare/v5.0.0-beta.6...v5.0.0-beta.7

... (truncated)

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)