Skip to content

Commit 9332e62

Browse files
committed
jda literally just exited beta LOL
1 parent 59f848d commit 9332e62

File tree

6 files changed

+110
-3
lines changed

6 files changed

+110
-3
lines changed

pom.xml

+15-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<dependency>
4848
<groupId>net.dv8tion</groupId>
4949
<artifactId>JDA</artifactId>
50-
<version>5.0.0-beta.24</version>
50+
<version>5.0.0</version>
5151
<exclusions>
5252
<exclusion>
5353
<groupId>club.minnced</groupId>
@@ -131,6 +131,20 @@
131131
<artifactId>maven-compiler-plugin</artifactId>
132132
<version>3.12.0</version>
133133
</plugin>
134+
<plugin>
135+
<groupId>org.apache.maven.plugins</groupId>
136+
<artifactId>maven-source-plugin</artifactId>
137+
<version>3.3.1</version>
138+
<executions>
139+
<execution>
140+
<id>attach-sources</id>
141+
<phase>verify</phase>
142+
<goals>
143+
<goal>jar-no-fork</goal>
144+
</goals>
145+
</execution>
146+
</executions>
147+
</plugin>
134148
</plugins>
135149
</build>
136150

src/main/java/dev/qixils/quasicord/decorators/ContextCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* Annotation for methods that represent context commands.
1818
* <p>
19-
* It is generally expected that the command have only one paramter representing the interaction or its subject,
19+
* It is generally expected that the command have only one parameter representing the interaction or its subject,
2020
* i.e. a {@link net.dv8tion.jda.api.entities.User User} object
2121
* for a {@link net.dv8tion.jda.api.interactions.commands.context.UserContextInteraction UserContextInteraction}.
2222
* However, this is not a strict limit, and other parameters may be added if applicable, and will be treated similarly

src/test/java/dev/qixils/quasicord/test/DummyApplicationInfo.java

+19
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import net.dv8tion.jda.api.entities.User;
1414
import org.jetbrains.annotations.NotNull;
1515
import org.jetbrains.annotations.Nullable;
16+
import org.jetbrains.annotations.Unmodifiable;
1617

1718
import java.util.Collection;
1819
import java.util.Collections;
@@ -113,6 +114,24 @@ public List<String> getTags() {
113114
return Collections.emptyList();
114115
}
115116

117+
@NotNull
118+
@Override
119+
public @Unmodifiable List<String> getRedirectUris() {
120+
return Collections.emptyList();
121+
}
122+
123+
@Nullable
124+
@Override
125+
public String getInteractionsEndpointUrl() {
126+
return null;
127+
}
128+
129+
@Nullable
130+
@Override
131+
public String getRoleConnectionsVerificationUrl() {
132+
return null;
133+
}
134+
116135
@Override
117136
public String getCustomAuthorizationUrl() {
118137
return null;

src/test/java/dev/qixils/quasicord/test/DummyJDA.java

+33
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import net.dv8tion.jda.api.OnlineStatus;
1313
import net.dv8tion.jda.api.Permission;
1414
import net.dv8tion.jda.api.entities.*;
15+
import net.dv8tion.jda.api.entities.channel.Channel;
1516
import net.dv8tion.jda.api.entities.channel.concrete.*;
1617
import net.dv8tion.jda.api.entities.channel.middleman.AudioChannel;
1718
import net.dv8tion.jda.api.entities.emoji.RichCustomEmoji;
@@ -28,9 +29,11 @@
2829
import net.dv8tion.jda.api.requests.GatewayIntent;
2930
import net.dv8tion.jda.api.requests.RestAction;
3031
import net.dv8tion.jda.api.requests.restaction.*;
32+
import net.dv8tion.jda.api.requests.restaction.pagination.EntitlementPaginationAction;
3133
import net.dv8tion.jda.api.sharding.ShardManager;
3234
import net.dv8tion.jda.api.utils.cache.CacheFlag;
3335
import net.dv8tion.jda.api.utils.cache.CacheView;
36+
import net.dv8tion.jda.api.utils.cache.ChannelCacheView;
3437
import net.dv8tion.jda.api.utils.cache.SnowflakeCacheView;
3538
import okhttp3.OkHttpClient;
3639
import org.checkerframework.checker.nullness.qual.NonNull;
@@ -362,6 +365,12 @@ public SnowflakeCacheView<ScheduledEvent> getScheduledEventCache() {
362365
return EmptySnowflakeCacheView.emptySnowflakeCacheView();
363366
}
364367

368+
@NotNull
369+
@Override
370+
public ChannelCacheView<Channel> getChannelCache() {
371+
return EmptyChannelCacheView.emptyChannelCacheView();
372+
}
373+
365374
@NonNull
366375
@Override
367376
public SnowflakeCacheView<StageChannel> getStageChannelCache() {
@@ -521,6 +530,30 @@ public RestAction<ApplicationInfo> retrieveApplicationInfo() {
521530
return new DummyRestAction<>(this, applicationInfo);
522531
}
523532

533+
@NotNull
534+
@Override
535+
public EntitlementPaginationAction retrieveEntitlements() {
536+
return null;
537+
}
538+
539+
@NotNull
540+
@Override
541+
public RestAction<Entitlement> retrieveEntitlementById(long id) {
542+
return new DummyRestAction<>(this);
543+
}
544+
545+
@NotNull
546+
@Override
547+
public TestEntitlementCreateAction createTestEntitlement(long l, long l1, @NotNull TestEntitlementCreateAction.OwnerType ownerType) {
548+
return null;
549+
}
550+
551+
@NotNull
552+
@Override
553+
public RestAction<Void> deleteTestEntitlement(long l) {
554+
return new DummyRestAction<>(this);
555+
}
556+
524557
@NonNull
525558
@Override
526559
public JDA setRequiredScopes(@NonNull Collection<String> scopes) {

src/test/java/dev/qixils/quasicord/test/DummySelfUser.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,11 @@ public AccountManager setName(@NotNull String name) {
120120
public AccountManager setAvatar(@Nullable Icon avatar) {
121121
return this;
122122
}
123-
}
123+
124+
@NotNull
125+
@Override
126+
public AccountManager setBanner(@Nullable Icon icon) {
127+
return this;
128+
}
129+
}
124130
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* This Source Code Form is subject to the terms of the Mozilla Public
3+
* License, v. 2.0. If a copy of the MPL was not distributed with this
4+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
5+
*/
6+
7+
package dev.qixils.quasicord.test;
8+
9+
import net.dv8tion.jda.api.entities.channel.Channel;
10+
import net.dv8tion.jda.api.entities.channel.ChannelType;
11+
import net.dv8tion.jda.api.utils.cache.ChannelCacheView;
12+
import org.jetbrains.annotations.NotNull;
13+
import org.jetbrains.annotations.Nullable;
14+
15+
public class EmptyChannelCacheView<T extends Channel> extends EmptySnowflakeCacheView<T> implements ChannelCacheView<T> {
16+
@NotNull
17+
@Override
18+
public <C extends T> ChannelCacheView<C> ofType(@NotNull Class<C> type) {
19+
return (ChannelCacheView<C>) this;
20+
}
21+
22+
@Nullable
23+
@Override
24+
public T getElementById(@NotNull ChannelType type, long id) {
25+
return null;
26+
}
27+
28+
@SuppressWarnings("rawtypes")
29+
private static final EmptyChannelCacheView EMPTY_CHANNEL_CACHE_VIEW = new EmptyChannelCacheView();
30+
31+
public static <T extends Channel> ChannelCacheView<T> emptyChannelCacheView() {
32+
//noinspection unchecked
33+
return (ChannelCacheView<T>) EMPTY_CHANNEL_CACHE_VIEW;
34+
}
35+
}

0 commit comments

Comments
 (0)