discord-jda/JDA (net.dv8tion:JDA)
### [`v5.0.2`](https://togithub.com/discord-jda/JDA/releases/tag/v5.0.2): | Single time event listener
### Overview
This release includes some bug fixes as well as a new event listener feature to add a one-time-use event listener.
##### Once Event Listener ([#2683](https://togithub.com/discord-jda/JDA/issues/2683))
A common problem that developers run into, is "waiting" for a specific event in the context of some command. For instance, waiting for a user to add a reaction or reply with a message in response to some prompt.
This can now be achieved using the new [listenOnce](https://docs.jda.wiki/net/dv8tion/jda/api/JDA.html#listenOnce\(java.lang.Class\)) event listener:
```java
// listen for a message event
jda.listenOnce(MessageReceivedEvent.class)
// filter for specific event
.filter(event -> event.getChannel().equals(channel))
.filter(event -> event.getAuthor().equals(user))
// handle timeout
.timeout(timeout, () -> hook.editOriginal("Timeout!").queue())
// subscribe to first event that matches filters
.subscribe(event -> {
hook.editOriginal("You sent: " + event.getMessage().getContentRaw()).queue();
});
```
#### New Features
- Add `TeamMember.RoleType` by [@freya022](https://togithub.com/freya022) in [https://github.com/discord-jda/JDA/pull/2703](https://togithub.com/discord-jda/JDA/pull/2703)
- Add abstract `createCopy` method in `SelectMenu` by [@Kaktushose](https://togithub.com/Kaktushose) in [https://github.com/discord-jda/JDA/pull/2684](https://togithub.com/discord-jda/JDA/pull/2684)
- Add `JDA#listenOnce` by [@freya022](https://togithub.com/freya022) in [https://github.com/discord-jda/JDA/pull/2683](https://togithub.com/discord-jda/JDA/pull/2683)
- Add support for profile automod by [@MinnDevelopment](https://togithub.com/MinnDevelopment) in [https://github.com/discord-jda/JDA/pull/2580](https://togithub.com/discord-jda/JDA/pull/2580)
#### Changes
- Expand list of retried http error codes by [@MinnDevelopment](https://togithub.com/MinnDevelopment) in [https://github.com/discord-jda/JDA/pull/2710](https://togithub.com/discord-jda/JDA/pull/2710)
- Update to Jackson 2.17.2 by [@freya022](https://togithub.com/freya022) in [https://github.com/discord-jda/JDA/pull/2695](https://togithub.com/discord-jda/JDA/pull/2695)
#### Bug Fixes
- Fix deserialization of interaction components by [@WitchBoo](https://togithub.com/WitchBoo) in [https://github.com/discord-jda/JDA/pull/2711](https://togithub.com/discord-jda/JDA/pull/2711)
**Full Changelog**: https://github.com/discord-jda/JDA/compare/v5.0.1...v5.0.2
### Installation
#### Gradle
```gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.2")
}
```
#### Maven
```xml
net.dv8tionJDA5.0.2
```
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
[ ] If you want to rebase/retry this PR, check this box
This PR contains the following updates:
5.0.1
->5.0.2
1.9.24
->1.9.25
Release Notes
discord-jda/JDA (net.dv8tion:JDA)
### [`v5.0.2`](https://togithub.com/discord-jda/JDA/releases/tag/v5.0.2): | Single time event listener ### Overview This release includes some bug fixes as well as a new event listener feature to add a one-time-use event listener. ##### Once Event Listener ([#2683](https://togithub.com/discord-jda/JDA/issues/2683)) A common problem that developers run into, is "waiting" for a specific event in the context of some command. For instance, waiting for a user to add a reaction or reply with a message in response to some prompt. This can now be achieved using the new [listenOnce](https://docs.jda.wiki/net/dv8tion/jda/api/JDA.html#listenOnce\(java.lang.Class\)) event listener: ```java // listen for a message event jda.listenOnce(MessageReceivedEvent.class) // filter for specific event .filter(event -> event.getChannel().equals(channel)) .filter(event -> event.getAuthor().equals(user)) // handle timeout .timeout(timeout, () -> hook.editOriginal("Timeout!").queue()) // subscribe to first event that matches filters .subscribe(event -> { hook.editOriginal("You sent: " + event.getMessage().getContentRaw()).queue(); }); ``` #### New Features - Add `TeamMember.RoleType` by [@freya022](https://togithub.com/freya022) in [https://github.com/discord-jda/JDA/pull/2703](https://togithub.com/discord-jda/JDA/pull/2703) - Add abstract `createCopy` method in `SelectMenu` by [@Kaktushose](https://togithub.com/Kaktushose) in [https://github.com/discord-jda/JDA/pull/2684](https://togithub.com/discord-jda/JDA/pull/2684) - Add `JDA#listenOnce` by [@freya022](https://togithub.com/freya022) in [https://github.com/discord-jda/JDA/pull/2683](https://togithub.com/discord-jda/JDA/pull/2683) - Add support for profile automod by [@MinnDevelopment](https://togithub.com/MinnDevelopment) in [https://github.com/discord-jda/JDA/pull/2580](https://togithub.com/discord-jda/JDA/pull/2580) #### Changes - Expand list of retried http error codes by [@MinnDevelopment](https://togithub.com/MinnDevelopment) in [https://github.com/discord-jda/JDA/pull/2710](https://togithub.com/discord-jda/JDA/pull/2710) - Update to Jackson 2.17.2 by [@freya022](https://togithub.com/freya022) in [https://github.com/discord-jda/JDA/pull/2695](https://togithub.com/discord-jda/JDA/pull/2695) #### Bug Fixes - Fix deserialization of interaction components by [@WitchBoo](https://togithub.com/WitchBoo) in [https://github.com/discord-jda/JDA/pull/2711](https://togithub.com/discord-jda/JDA/pull/2711) **Full Changelog**: https://github.com/discord-jda/JDA/compare/v5.0.1...v5.0.2 ### Installation #### Gradle ```gradle repositories { mavenCentral() } dependencies { implementation("net.dv8tion:JDA:5.0.2") } ``` #### Maven ```xmlConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.