Skip to content

v5.0.0-beta.24 | Bug fixes and entitlement types

Latest
Compare
Choose a tag to compare
@MinnDevelopment MinnDevelopment released this 12 May 15:01
e24872e

Overview

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

Additional Entitlement Features (#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.

public boolean hasEntitlement(long skuId, List<Entitlement> entitlements) {
  return entitlements.stream().anyMatch(e -> e.getSkuIdLong() == skuId && !e.isConsumed());
}
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

Changes

Bug Fixes

Full Changelog: v5.0.0-beta.23...v5.0.0-beta.24

Installation

Gradle

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

Maven

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