update dependencies and repositories
This commit is contained in:
parent
c44be4ebd7
commit
bad541cc65
|
|
@ -1,53 +1,66 @@
|
|||
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
|
||||
|
||||
plugins {
|
||||
java
|
||||
`maven-publish`
|
||||
id("com.github.johnrengelman.shadow") version "7.0.0"
|
||||
id("com.github.johnrengelman.shadow") version "7.1.0"
|
||||
}
|
||||
|
||||
allprojects {
|
||||
val build = System.getenv("BUILD_NUMBER") ?: "SNAPSHOT"
|
||||
group = "com.alttd.proxydiscordlink"
|
||||
version = "1.0.0-BETA-$build"
|
||||
description = "A velocity plugin to link Discord and Minecraft accounts."
|
||||
group = "com.alttd.proxydiscordlink"
|
||||
version = "1.0.0-BETA-SNAPSHOT"
|
||||
description = "A velocity plugin to link Discord and Minecraft accounts."
|
||||
|
||||
apply(plugin = "java")
|
||||
apply(plugin = "maven-publish")
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(16))
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<JavaCompile> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
options.release.set(16)
|
||||
}
|
||||
|
||||
withType<Javadoc> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<JavaCompile> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
options.release.set(17)
|
||||
}
|
||||
|
||||
withType<Javadoc> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
dependsOn(getByName("relocateJars") as ConfigureShadowRelocation)
|
||||
archiveFileName.set("${project.name}-${project.version}.jar")
|
||||
minimize()
|
||||
configurations = listOf(project.configurations.shadow.get())
|
||||
}
|
||||
|
||||
build {
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
|
||||
create<ConfigureShadowRelocation>("relocateJars") {
|
||||
target = shadowJar.get()
|
||||
prefix = "${project.name}.lib"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
// Minimessage
|
||||
implementation("net.kyori:adventure-text-minimessage:4.1.0-SNAPSHOT") {
|
||||
exclude("net.kyori")
|
||||
exclude("net.kyori.examination")
|
||||
// Minimessage // TODO : update all usages to 4.2
|
||||
shadow("net.kyori:adventure-text-minimessage:4.2.0-SNAPSHOT") {
|
||||
exclude("net.kyori", "adventure-api")
|
||||
}
|
||||
// Velocity
|
||||
compileOnly("com.velocitypowered:velocity-api:1.1.5")
|
||||
annotationProcessor("com.velocitypowered:velocity-api:1.1.5")
|
||||
compileOnly("com.velocitypowered:velocity-api:3.0.1")
|
||||
annotationProcessor("com.velocitypowered:velocity-api:3.0.1")
|
||||
// JDA
|
||||
implementation("net.dv8tion:JDA:4.3.0_283") {
|
||||
shadow("net.dv8tion:JDA:5.0.0-alpha.3") {
|
||||
exclude("opus-java") // exclude audio
|
||||
}
|
||||
// LuckPerms
|
||||
compileOnly("net.luckperms:api:5.3")
|
||||
// MySQL
|
||||
runtimeOnly("mysql:mysql-connector-java:8.0.23")
|
||||
shadow("mysql:mysql-connector-java:8.0.25")
|
||||
// ShutdownInfo
|
||||
compileOnly("com.alttd:ShutdownInfo:1.0")
|
||||
}
|
||||
|
|
@ -62,28 +75,8 @@ publishing {
|
|||
repositories{
|
||||
maven {
|
||||
name = "maven"
|
||||
url = uri("http://leo:8081/")
|
||||
isAllowInsecureProtocol = true
|
||||
url = uri("https://repo.destro.xyz/snapshots")
|
||||
credentials(PasswordCredentials::class)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
||||
shadowJar {
|
||||
archiveFileName.set("${project.name}-${project.version}.jar")
|
||||
// exclude("net.kyori")
|
||||
// exclude("net.kyori.examination")
|
||||
listOf(
|
||||
// "net.kyori",
|
||||
"net.dv8tion.jda",
|
||||
"net.kyori.adventure.text.minimessage"
|
||||
).forEach { relocate(it, "${rootProject.group}.lib.$it") }
|
||||
}
|
||||
|
||||
build {
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -6,9 +6,8 @@ dependencyResolutionManagement {
|
|||
// Altitude
|
||||
maven {
|
||||
name = "maven"
|
||||
url = uri("http://leo:8081/")
|
||||
isAllowInsecureProtocol = true
|
||||
//credentials(PasswordCredentials::class)
|
||||
url = uri("https://repo.destro.xyz/snapshots")
|
||||
credentials(PasswordCredentials::class)
|
||||
}
|
||||
// Velocity
|
||||
maven("https://nexus.velocitypowered.com/repository/maven-public/")
|
||||
|
|
@ -16,8 +15,6 @@ dependencyResolutionManagement {
|
|||
maven("https://m2.dv8tion.net/releases/")
|
||||
// MiniMessage
|
||||
maven("https://oss.sonatype.org/content/repositories/snapshots/")
|
||||
// Local maven repo .m2
|
||||
mavenLocal()
|
||||
}
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,9 +87,9 @@ public class Bot {
|
|||
if (embedBuilder.isEmpty()) return;
|
||||
try {
|
||||
if (secondsTillDelete < 0) {
|
||||
channel.sendMessage(embedBuilder.build()).queue();
|
||||
channel.sendMessageEmbeds(embedBuilder.build()).queue();
|
||||
} else {
|
||||
channel.sendMessage(embedBuilder.build()).queue(message -> message.delete().queueAfter(secondsTillDelete, TimeUnit.SECONDS));
|
||||
channel.sendMessageEmbeds(embedBuilder.build()).queue(message -> message.delete().queueAfter(secondsTillDelete, TimeUnit.SECONDS));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ALogger.error("caught some exception, " + e);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import com.alttd.proxydiscordlink.DiscordLink;
|
|||
import com.alttd.proxydiscordlink.bot.Bot;
|
||||
import com.alttd.proxydiscordlink.bot.DiscordCommand;
|
||||
import com.alttd.proxydiscordlink.config.BotConfig;
|
||||
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
|
@ -21,7 +21,7 @@ public class DiscordMessageListener extends ListenerAdapter {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onGuildMessageReceived(GuildMessageReceivedEvent event) {
|
||||
public void onMessageReceived(MessageReceivedEvent event) {
|
||||
if (event.getAuthor() == event.getJDA().getSelfUser()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user