Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make channel access checks consistent #2679

Merged
merged 2 commits into from
May 12, 2024
Merged

Conversation

MinnDevelopment
Copy link
Member

Pull Request Etiquette

Changes

  • Internal code
  • Library interface (affecting end-user code)
  • Documentation
  • Other: _____

Closes #2678

Description

Makes checks for channel access consistent.

@MinnDevelopment MinnDevelopment merged commit 46875ff into master May 12, 2024
1 check passed
@MinnDevelopment MinnDevelopment deleted the patch/missing-access branch May 12, 2024 14:03
mergify bot pushed a commit to SvenKirschbaum/musikbot-client that referenced this pull request May 19, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|---|---|
| debian | final | digest | `155280b` -> `804194b` |  |  |  |  |
| rust | stage | digest | `0dd183f` -> `5907e96` |  |  |  |  |
| [net.dv8tion:JDA](https://togithub.com/DV8FromTheWorld/JDA) | compile | patch | `5.0.0-beta.23` -> `5.0.0-beta.24` | [![age](https://developer.mend.io/api/mc/badges/age/maven/net.dv8tion:JDA/5.0.0-beta.24?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/net.dv8tion:JDA/5.0.0-beta.24?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/net.dv8tion:JDA/5.0.0-beta.23/5.0.0-beta.24?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/net.dv8tion:JDA/5.0.0-beta.23/5.0.0-beta.24?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>DV8FromTheWorld/JDA (net.dv8tion:JDA)</summary>

### [`v5.0.0-beta.24`](https://togithub.com/discord-jda/JDA/releases/tag/v5.0.0-beta.24): | Bug fixes and entitlement types

### Overview

This is a small bugfix release, including some missing features for **premium app entitlements**.

##### Additional Entitlement Features ([#&#8203;2667](https://togithub.com/DV8FromTheWorld/JDA/issues/2667))

This release adds support for **test entitlements** and **consumed entitlements**.

An entitlement can be *consumed*, marking it as already used. This can be useful for one-time entitlements, which are consumed on use.

```java
public boolean hasEntitlement(long skuId, List<Entitlement> entitlements) {
  return entitlements.stream().anyMatch(e -> e.getSkuIdLong() == skuId && !e.isConsumed());
}
```

```java
public void consumeEntitlement(long skuId, List<Entitlement> entitlements) {
  entitlements.stream()
    .filter(e -> e.getSkuIdLong() == skuId && !e.isConsumed())
    .findFirst()
    .ifPresent(entitlement -> entitlement.consume().queue());
}
```

#### New Features

-   Add `IPostContainerManager#setTopic` by [@&#8203;freya022](https://togithub.com/freya022) in [discord-jda/JDA#2666
-   Add missing features relating to premium app subscriptions by [@&#8203;Tobias123567](https://togithub.com/Tobias123567) in [discord-jda/JDA#2667

#### Changes

-   Improve logging for gateway connection by [@&#8203;MinnDevelopment](https://togithub.com/MinnDevelopment) in [discord-jda/JDA#2665
-   Add more static analyzer annotations by [@&#8203;MinnDevelopment](https://togithub.com/MinnDevelopment) in [discord-jda/JDA#2675
-   Update SLF4J api and jackson by [@&#8203;MinnDevelopment](https://togithub.com/MinnDevelopment) in [discord-jda/JDA#2674

#### Bug Fixes

-   Fix ClassCastException in EntityBuilder#updateMemberCache by [@&#8203;Xirado](https://togithub.com/Xirado) in [discord-jda/JDA#2660
-   Properly copy poll data in MessageCreateRequest#applyData by [@&#8203;MinnDevelopment](https://togithub.com/MinnDevelopment) in [discord-jda/JDA#2662
-   Make channel access checks consistent by [@&#8203;MinnDevelopment](https://togithub.com/MinnDevelopment) in [discord-jda/JDA#2679

**Full Changelog**: discord-jda/JDA@v5.0.0-beta.23...v5.0.0-beta.24

### Installation

#### Gradle

```gradle
repositories {
    mavenCentral()
}
dependencies {
    implementation("net.dv8tion:JDA:5.0.0-beta.24")
}
```

#### Maven

```xml
<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>5.0.0-beta.24</version> 
</dependency>
```

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on sunday" in timezone Europe/Berlin, 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](https://togithub.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/SvenKirschbaum/musikbot-client).
BachErik added a commit to TwitchTube/DiscordBot that referenced this pull request May 29, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [net.dv8tion:JDA](https://togithub.com/DV8FromTheWorld/JDA) |
`5.0.0-beta.23` -> `5.0.0-beta.24` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/net.dv8tion:JDA/5.0.0-beta.24?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/net.dv8tion:JDA/5.0.0-beta.24?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/net.dv8tion:JDA/5.0.0-beta.23/5.0.0-beta.24?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/net.dv8tion:JDA/5.0.0-beta.23/5.0.0-beta.24?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>DV8FromTheWorld/JDA (net.dv8tion:JDA)</summary>

###
[`v5.0.0-beta.24`](https://togithub.com/discord-jda/JDA/releases/tag/v5.0.0-beta.24):
| Bug fixes and entitlement types

### Overview

This is a small bugfix release, including some missing features for
**premium app entitlements**.

##### Additional Entitlement Features
([#&#8203;2667](https://togithub.com/DV8FromTheWorld/JDA/issues/2667))

This release adds support for **test entitlements** and **consumed
entitlements**.

An entitlement can be *consumed*, marking it as already used. This can
be useful for one-time entitlements, which are consumed on use.

```java
public boolean hasEntitlement(long skuId, List<Entitlement> entitlements) {
  return entitlements.stream().anyMatch(e -> e.getSkuIdLong() == skuId && !e.isConsumed());
}
```

```java
public void consumeEntitlement(long skuId, List<Entitlement> entitlements) {
  entitlements.stream()
    .filter(e -> e.getSkuIdLong() == skuId && !e.isConsumed())
    .findFirst()
    .ifPresent(entitlement -> entitlement.consume().queue());
}
```

#### New Features

- Add `IPostContainerManager#setTopic` by
[@&#8203;freya022](https://togithub.com/freya022) in
[discord-jda/JDA#2666
- Add missing features relating to premium app subscriptions by
[@&#8203;Tobias123567](https://togithub.com/Tobias123567) in
[discord-jda/JDA#2667

#### Changes

- Improve logging for gateway connection by
[@&#8203;MinnDevelopment](https://togithub.com/MinnDevelopment) in
[discord-jda/JDA#2665
- Add more static analyzer annotations by
[@&#8203;MinnDevelopment](https://togithub.com/MinnDevelopment) in
[discord-jda/JDA#2675
- Update SLF4J api and jackson by
[@&#8203;MinnDevelopment](https://togithub.com/MinnDevelopment) in
[discord-jda/JDA#2674

#### Bug Fixes

- Fix ClassCastException in EntityBuilder#updateMemberCache by
[@&#8203;Xirado](https://togithub.com/Xirado) in
[discord-jda/JDA#2660
- Properly copy poll data in MessageCreateRequest#applyData by
[@&#8203;MinnDevelopment](https://togithub.com/MinnDevelopment) in
[discord-jda/JDA#2662
- Make channel access checks consistent by
[@&#8203;MinnDevelopment](https://togithub.com/MinnDevelopment) in
[discord-jda/JDA#2679

**Full Changelog**:
discord-jda/JDA@v5.0.0-beta.23...v5.0.0-beta.24

### Installation

#### Gradle

```gradle
repositories {
    mavenCentral()
}
dependencies {
    implementation("net.dv8tion:JDA:5.0.0-beta.24")
}
```

#### Maven

```xml
<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>5.0.0-beta.24</version> 
</dependency>
```

</details>

---

### 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.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/TwitchTube/DiscordBot).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM1MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bot can't delete voice channel even with MANAGE_CHANNEL
1 participant