Compare commits
6
Commits
forms
..
81b53cd1f8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81b53cd1f8 | ||
|
|
34f9559d10 | ||
|
|
f2864ade8a | ||
|
|
cd356121b7 | ||
|
|
1f706b69b8 | ||
|
|
8f6d1137ae |
Vendored
+2
-2
@@ -3,7 +3,7 @@ pipeline {
|
||||
stages {
|
||||
stage('Gradle') {
|
||||
steps {
|
||||
sh 'bash ./gradlew build'
|
||||
sh 'bash ./gradlew shadowJar'
|
||||
}
|
||||
}
|
||||
stage('Archive') {
|
||||
@@ -17,4 +17,4 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+17
-13
@@ -1,9 +1,10 @@
|
||||
|
||||
plugins {
|
||||
id("java")
|
||||
id("com.github.johnrengelman.shadow") version "7.1.0"
|
||||
id("com.github.johnrengelman.shadow") version "8.1.1"
|
||||
id("maven-publish")
|
||||
id("org.springframework.boot") version("2.7.8")
|
||||
id("org.springframework.boot") version("3.5.3")
|
||||
id("com.github.ben-manes.versions") version "0.52.0"
|
||||
}
|
||||
|
||||
group = "com.alttd"
|
||||
@@ -12,7 +13,7 @@ description = "Altitude Discord Bot."
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
languageVersion.set(JavaLanguageVersion.of(21))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,23 +60,26 @@ tasks {
|
||||
|
||||
dependencies {
|
||||
// JDA
|
||||
implementation("net.dv8tion:JDA:5.0.2") {
|
||||
implementation("net.dv8tion:JDA:5.6.1") {
|
||||
exclude("opus-java") // exclude audio
|
||||
}
|
||||
// MySQL
|
||||
implementation("mysql:mysql-connector-java:8.0.33")
|
||||
|
||||
// Configurate
|
||||
implementation("org.spongepowered:configurate-yaml:4.1.2")
|
||||
implementation("org.spongepowered:configurate-yaml:4.2.0")
|
||||
|
||||
// Excel
|
||||
implementation("org.apache.poi:poi:5.2.0")
|
||||
implementation("org.apache.poi:poi-ooxml:5.2.0")
|
||||
implementation("org.apache.poi:poi:5.4.1")
|
||||
implementation("org.apache.poi:poi-ooxml:5.4.1")
|
||||
// Other stuff?
|
||||
compileOnly("org.projectlombok:lombok:1.18.30")
|
||||
annotationProcessor("org.projectlombok:lombok:1.18.24")
|
||||
compileOnly("org.projectlombok:lombok:1.18.38")
|
||||
annotationProcessor("org.projectlombok:lombok:1.18.38")
|
||||
implementation("com.alttd:AltitudeLogs:1.0")
|
||||
implementation("org.springframework.boot:spring-boot-starter-web:3.2.1")
|
||||
implementation("org.springframework.boot:spring-boot-starter-validation:3.2.1")
|
||||
implementation("com.google.code.gson:gson:2.8.9")
|
||||
}
|
||||
implementation("org.springframework.boot:spring-boot-starter-web:3.5.3")
|
||||
implementation("org.springframework.boot:spring-boot-starter-validation:3.5.3")
|
||||
implementation("com.google.code.gson:gson:2.13.1")
|
||||
|
||||
testImplementation(platform("org.junit:junit-bom:5.13.1"))
|
||||
testImplementation("org.junit.jupiter:junit-jupiter")
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.alttd.util.Util;
|
||||
import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.JDA;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.IMentionable;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||
import net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent;
|
||||
@@ -27,10 +26,12 @@ import java.util.stream.Collectors;
|
||||
|
||||
public class CommandStaffJoinDate extends DiscordCommand {
|
||||
|
||||
private final CommandData commandData;
|
||||
|
||||
public CommandStaffJoinDate(JDA jda, CommandManager commandManager) {
|
||||
CommandData commandData = Commands.slash(getName(), "View join date for staff members, or add them manually")
|
||||
.addOption(OptionType.MENTIONABLE, "staff", "Set the soft lock \"on\" or \"off\"", false, true)
|
||||
.addOption(OptionType.NUMBER, "join-time", "Channel to change soft lock state for", false, true)
|
||||
this.commandData = Commands.slash(getName(), "View join date for staff members, or add them manually")
|
||||
.addOption(OptionType.MENTIONABLE, "staff", "The staff member to set/check the join date for", false, false)
|
||||
.addOption(OptionType.INTEGER, "join-time", "The join date to set", false, false)
|
||||
.setDefaultPermissions(DefaultMemberPermissions.enabledFor(Permission.ADMINISTRATOR))
|
||||
.setGuildOnly(true);
|
||||
|
||||
@@ -53,6 +54,7 @@ public class CommandStaffJoinDate extends DiscordCommand {
|
||||
interactionHook.editOriginalEmbeds(getFullStaffEmbed()).queue();
|
||||
return;
|
||||
}
|
||||
|
||||
Member member = staff.getAsMember();
|
||||
if (member == null) {
|
||||
interactionHook.editOriginalEmbeds(Util.genericErrorEmbed("Invalid member", String.format("%s is not a valid member", staff.getAsMentionable().getAsMention()))).queue();
|
||||
@@ -104,7 +106,7 @@ public class CommandStaffJoinDate extends DiscordCommand {
|
||||
|
||||
@Override
|
||||
public void suggest(CommandAutoCompleteInteractionEvent event) {
|
||||
|
||||
event.replyChoiceStrings(List.of()).queue();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,6 +116,6 @@ public class CommandStaffJoinDate extends DiscordCommand {
|
||||
|
||||
@Override
|
||||
public CommandData getCommandData() {
|
||||
return null;
|
||||
return commandData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class QueriesStaffJoinDate {
|
||||
}
|
||||
|
||||
public static void setJoinDate(long userId, Instant date) {
|
||||
String sql = "INSERT INTO staff_join_date (user_id, date) VALUES (?, ?)";
|
||||
String sql = "INSERT INTO staff_join_date (user_id, date) VALUES (?, ?) ON DUPLICATE KEY UPDATE date = VALUES(date)";
|
||||
|
||||
try (PreparedStatement preparedStatement = Database.getDatabase().getConnection().prepareStatement(sql)) {
|
||||
preparedStatement.setLong(1, userId);
|
||||
|
||||
Reference in New Issue
Block a user