Skip to content

Commit 455f158

Browse files
committed
update
1 parent 9807da4 commit 455f158

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1150
-1221
lines changed

build.gradle

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ plugins {
88
alias(libs.plugins.lombok)
99
}
1010

11-
def baseVersion = "4.0.4"
11+
wrapper {
12+
gradleVersion = '8.1.1'
13+
}
14+
15+
def baseVersion = "4.0.7"
1216
def isSnapshot = false
1317

1418
version = (isSnapshot) ? baseVersion + '-SNAPSHOT' : baseVersion
1519
group = 'io.github.readonly'
1620
archivesBaseName = 'JDATools'
1721

22+
dependencyUpdates.gradleReleaseChannel="current"
23+
1824
java {
1925
withJavadocJar()
2026
withSourcesJar()
@@ -28,7 +34,7 @@ repositories {
2834
dependencies {
2935
api(libs.jda) { exclude module: 'opus-java' }
3036
implementation libs.json
31-
api libs.slf4j
37+
compileOnly libs.slf4j
3238
api libs.guava
3339
api libs.guice
3440
api libs.commons.lang3
@@ -42,11 +48,10 @@ license {
4248
include '**/*.java'
4349
}
4450

45-
compileJava.options.encoding = 'UTF-8'
46-
47-
tasks.withType(JavaCompile) {
48-
options.encoding = 'UTF-8'
49-
classpath += sourceSets.main.compileClasspath
51+
tasks.withType(JavaCompile).configureEach {
52+
classpath += sourceSets.main.compileClasspath
53+
options.deprecation = true
54+
options.encoding = 'UTF-8'
5055
}
5156

5257
javadoc {

gradle/libs.versions.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ version = "1.0"
33

44
[versions]
55

6-
jda = "5.0.0-beta.8"
7-
json = "20220320"
6+
jda = "5.0.0-beta.10"
7+
json = "20230227"
88
lang3 = "3.12.0"
9-
jackson = "2.14.1"
9+
jackson = "2.15.2"
1010
lombok = "1.18.24"
11-
guava = "31.1-jre"
12-
guice = "5.1.0"
13-
slf4j = "1.7.32"
11+
guava = "32.0.0-jre"
12+
guice = "7.0.0"
13+
slf4j = "1.7.36"
1414
licenser = "0.6.1"
1515
lombokplugin = "8.0.1"
16-
versionsPlugin = "0.42.0"
16+
versionsPlugin = "0.46.0"
1717

1818
[libraries]
1919
json = { module = "org.json:json", version.ref = "json" }

gradle/wrapper/gradle-wrapper.jar

2.48 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

gradlew

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#
4-
# Copyright © 2015-2021 the original authors.
4+
# Copyright © 2015-2021 the original authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -32,10 +32,10 @@
3232
# Busybox and similar reduced shells will NOT work, because this script
3333
# requires all of these POSIX shell features:
3434
# * functions;
35-
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
36-
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
37-
# * compound commands having a testable exit status, especially «case»;
38-
# * various built-in commands including «command», «set», and «ulimit».
35+
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
36+
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
37+
# * compound commands having a testable exit status, especially «case»;
38+
# * various built-in commands including «command», «set», and «ulimit».
3939
#
4040
# Important for patching:
4141
#
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,13 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
87-
88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
9087

9188
# Use the maximum available, or set MAX_FD != -1 to use that value.
9289
MAX_FD=maximum
@@ -143,12 +140,16 @@ fi
143140
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144141
case $MAX_FD in #(
145142
max*)
143+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
144+
# shellcheck disable=SC3045
146145
MAX_FD=$( ulimit -H -n ) ||
147146
warn "Could not query maximum file descriptor limit"
148147
esac
149148
case $MAX_FD in #(
150149
'' | soft) :;; #(
151150
*)
151+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
152+
# shellcheck disable=SC3045
152153
ulimit -n "$MAX_FD" ||
153154
warn "Could not set maximum file descriptor limit to $MAX_FD"
154155
esac
@@ -193,6 +194,10 @@ if "$cygwin" || "$msys" ; then
193194
done
194195
fi
195196

197+
198+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
199+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
200+
196201
# Collect all arguments for the java command;
197202
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
198203
# shell script including quotes and variable substitutions, so put them in
@@ -205,6 +210,12 @@ set -- \
205210
org.gradle.wrapper.GradleWrapperMain \
206211
"$@"
207212

213+
# Stop when "xargs" is not available.
214+
if ! command -v xargs >/dev/null 2>&1
215+
then
216+
die "xargs is not available"
217+
fi
218+
208219
# Use "xargs" to parse quoted args.
209220
#
210221
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.

gradlew.bat

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@rem limitations under the License.
1515
@rem
1616

17-
@if "%DEBUG%" == "" @echo off
17+
@if "%DEBUG%"=="" @echo off
1818
@rem ##########################################################################
1919
@rem
2020
@rem Gradle startup script for Windows
@@ -25,7 +25,8 @@
2525
if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
28-
if "%DIRNAME%" == "" set DIRNAME=.
28+
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4041

4142
set JAVA_EXE=java.exe
4243
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto execute
44+
if %ERRORLEVEL% equ 0 goto execute
4445

4546
echo.
4647
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
7576

7677
:end
7778
@rem End local scope for the variables with windows NT shell
78-
if "%ERRORLEVEL%"=="0" goto mainEnd
79+
if %ERRORLEVEL% equ 0 goto mainEnd
7980

8081
:fail
8182
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
8283
rem the _cmd.exe /c_ return code!
83-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84-
exit /b 1
84+
set EXIT_CODE=%ERRORLEVEL%
85+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
86+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87+
exit /b %EXIT_CODE%
8588

8689
:mainEnd
8790
if "%OS%"=="Windows_NT" endlocal

src/main/java/io/github/readonly/Properties.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
/*
2+
* This file is part of JDATools, licensed under the MIT License (MIT).
3+
*
4+
* Copyright (c) ROMVoid95
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
125
package io.github.readonly;
226

327
public class Properties

src/main/java/io/github/readonly/api/BotContainer.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
/*
2+
* This file is part of JDATools, licensed under the MIT License (MIT).
3+
*
4+
* Copyright (c) ROMVoid95
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
125
package io.github.readonly.api;
226

327
import java.util.Optional;
@@ -42,7 +66,9 @@ default Optional<String> getVersion() {
4266
*
4367
* @return The instance if available
4468
*/
45-
Optional<?> getInstance();
69+
default Optional<?> getInstance() {
70+
return Optional.empty();
71+
}
4672

4773
/**
4874
* Returns the assigned logger to this {@link Bot}.

src/main/java/io/github/readonly/api/ClientInterface.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ default void addCommands(Command... commands)
248248
* @throws java.lang.IllegalArgumentException
249249
* If the Context Menu provided has a name that has already been registered
250250
*/
251-
void addContextMenu(ContextMenu menu);
251+
void indexContextMenu(ContextMenu menu);
252252

253253
/**
254254
* Adds a single {@link ContextMenu} to this CommandClient's registered Context Menus.
@@ -261,7 +261,7 @@ default void addCommands(Command... commands)
261261
* @throws java.lang.IllegalArgumentException
262262
* If the Context Menu provided has a name that has already been registered
263263
*/
264-
void addContextMenu(ContextMenu menu, int index);
264+
void indexContextMenu(ContextMenu menu, int index);
265265

266266
/**
267267
* Removes a single {@link io.github.readonly.command.Command Command} from this Client's registered Commands at the

src/main/java/io/github/readonly/api/identity/Bot.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
/*
2+
* This file is part of JDATools, licensed under the MIT License (MIT).
3+
*
4+
* Copyright (c) ROMVoid95
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
125
package io.github.readonly.api.identity;
226

327
public interface Bot extends Identifiable

0 commit comments

Comments
 (0)