Skip to content

Commit 7e359e3

Browse files
committed
Update Javacord version to 3.4.0
1 parent d4e050d commit 7e359e3

File tree

7 files changed

+16
-11
lines changed

7 files changed

+16
-11
lines changed

buildSrc/src/main/kotlin/net/kautler/versions.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ repositories {
3737
}
3838

3939
val messageFrameworkVersions by extra(mapOf(
40-
"javacord" to listOf("3.1.1"),
40+
"javacord" to listOf("3.4.0"),
4141
"jda" to listOf("4.2.0_214")
4242
))
4343

config/pmd/pmd.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@
110110
<property name="constantPattern" value="[a-z][a-zA-Z0-9]*|[A-Z][A-Z_0-9]*"/>
111111
</properties>
112112
</rule>
113+
<rule ref="category/java/codestyle.xml/FormalParameterNamingConventions">
114+
<properties>
115+
<property name="lambdaParameterPattern" value="[a-z][a-zA-Z0-9]*|__+" />
116+
</properties>
117+
</rule>
113118
<rule ref="category/java/codestyle.xml/LinguisticNaming">
114119
<properties>
115120
<property name="violationSuppressXPath">

examples/simplePingBotJavacord/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2020 Björn Kautler
2+
* Copyright 2019-2022 Björn Kautler
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ dependencies {
2929
runtimeOnly("org.jboss.weld.se:weld-se-core:3.1.2.Final") { because("CDI implementation") }
3030
runtimeOnly("org.jboss:jandex:2.1.1.Final") { because("faster CDI bean scanning") }
3131

32-
implementation("org.javacord:javacord:3.0.5")
32+
implementation("org.javacord:javacord:3.4.0")
3333
implementation("org.apache.logging.log4j:log4j-api:2.12.1")
3434

3535
runtimeOnly("org.apache.logging.log4j:log4j-core:2.12.1")

src/javacordIntegTest/groovy/net/kautler/command/integ/test/javacord/restriction/EveryoneIntegTest.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Björn Kautler
2+
* Copyright 2019-2022 Björn Kautler
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -82,7 +82,7 @@ class EveryoneIntegTest extends Specification {
8282
}
8383

8484
when:
85-
new WebhookClientBuilder(webhook.id, webhook.token.orElseThrow { new AssertionError() })
85+
new WebhookClientBuilder(webhook.id, webhook.token)
8686
.setWait(false)
8787
.build()
8888
.send("!ping $random")

src/javacordIntegTest/groovy/net/kautler/command/integ/test/javacord/restriction/RegularUserJavacordIntegTest.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Björn Kautler
2+
* Copyright 2019-2022 Björn Kautler
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -64,7 +64,7 @@ class RegularUserJavacordIntegTest extends Specification {
6464
.join()
6565

6666
when:
67-
new WebhookClientBuilder(webhook.id, webhook.token.orElseThrow { new AssertionError() })
67+
new WebhookClientBuilder(webhook.id, webhook.token)
6868
.setWait(false)
6969
.build()
7070
.send('!ping')

src/main/java/net/kautler/command/handler/CommandHandlerJavacord.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ protected void fireCommandNotFoundEvent(CommandContext<Message> commandContext)
181181
@Override
182182
protected void executeAsync(CommandContext<Message> commandContext, Runnable commandExecutor) {
183183
runAsync(commandExecutor, commandContext.getMessage().getApi().getThreadPool().getExecutorService())
184-
.whenComplete((nothing, throwable) -> {
184+
.whenComplete((__, throwable) -> {
185185
if (throwable != null) {
186186
logger.error("Exception while executing command asynchronously", throwable);
187187
}

src/test/groovy/net/kautler/command/handler/CommandHandlerJavacordTest.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ class CommandHandlerJavacordTest extends Specification {
356356

357357
def 'asynchronous command execution should happen asynchronously'() {
358358
given:
359-
def discordApi = new DiscordApiImpl(null, null, null, null, null, false)
359+
def discordApi = new DiscordApiImpl(null, null, null, null, null, null, false)
360360
message.api >> discordApi
361361
def executingThread = new BlockingVariable<Thread>(5)
362362

@@ -374,7 +374,7 @@ class CommandHandlerJavacordTest extends Specification {
374374

375375
def 'asynchronous command execution should not log an error if none happened'() {
376376
given:
377-
def discordApi = new DiscordApiImpl(null, null, null, null, null, false)
377+
def discordApi = new DiscordApiImpl(null, null, null, null, null, null, false)
378378
message.api >> discordApi
379379

380380
when:
@@ -396,7 +396,7 @@ class CommandHandlerJavacordTest extends Specification {
396396

397397
def 'exception during asynchronous command execution should be logged properly'() {
398398
given:
399-
def discordApi = new DiscordApiImpl(null, null, null, null, null, false)
399+
def discordApi = new DiscordApiImpl(null, null, null, null, null, null, false)
400400
message.api >> discordApi
401401
def exception = new Exception()
402402

0 commit comments

Comments
 (0)