Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
82a0f70
Maintenance mode, MessageCommands
devExcale Sep 14, 2021
c906d3f
Improved maintenance mode
devExcale Sep 14, 2021
681f150
Implemented Lombok
devExcale Sep 14, 2021
9a5de71
Log when restarting
devExcale Sep 14, 2021
14fb5d2
Fixed a bug where the bot wouldn't "hello world" on restart
devExcale Oct 16, 2021
c1a59cc
More Lombok
devExcale Oct 16, 2021
f552386
Added reload button on TrackIndex
devExcale Oct 16, 2021
e986f4a
Get Maintenance Flag on application creation
devExcale Oct 16, 2021
6e25822
Added a close button to TrackIndex
devExcale Oct 16, 2021
3c6b1b7
Version upgrade
devExcale Oct 16, 2021
742981a
Added uploaded tracks to UserModel
devExcale Oct 18, 2021
026df48
Added TrackRemove command
devExcale Oct 19, 2021
ddba38a
Moved related commands to 'commands.track' package
devExcale Oct 19, 2021
0a914f8
Renamed TrackUpload command
devExcale Oct 19, 2021
e549c14
Version upgrade
devExcale Oct 19, 2021
1026769
Set TrackIndex's reply as ephimeral
devExcale Oct 19, 2021
30254c2
Version upgrade
devExcale Oct 19, 2021
6fb7a7b
Excluded .env from jar build
devExcale Oct 21, 2021
da6f623
Removed fulfilled TODO
devExcale Oct 22, 2021
71c1f00
feat: Added options to TrackIndex
devExcale Jan 3, 2022
5725cfd
feat: Added command to download track
devExcale Jan 3, 2022
12a146a
fix: removed single-guild mode (used for develop purpose)
devExcale Jan 3, 2022
5bb6c53
feat: TrackIndex now comes right after command reply
devExcale Feb 2, 2022
7c990e5
feat: TrackIndex now with filters (track name, uploader...)
devExcale Feb 3, 2022
c54b5c7
feat: Added filter notes on title and footer in TrackIndex
devExcale Feb 3, 2022
f580cb9
feat: Added cyclic TrackIndex pages (from first to last and vice versa)
devExcale Feb 3, 2022
c8fee0c
Version upgrade (minor)
devExcale Feb 3, 2022
3b904a2
fix: Fixed TrackIndex name filter always returning blank page
devExcale Feb 3, 2022
7f28b5d
fix: Upgraded PostgreSQL version for security reasons
devExcale Feb 3, 2022
281b78a
feat: Merged AbstractSlashCommand and AbstractMessageCommand into one…
devExcale Feb 4, 2022
0187a3f
other: added TODO
devExcale Feb 4, 2022
ccaaeea
refactor: moved commands into each respective command type package
devExcale Feb 4, 2022
01711d4
refactor: Moved command-related classes to `command.core` package
devExcale Feb 4, 2022
57e3636
feature: Created TrackIndex class, which wraps all db/filter logic an…
devExcale Feb 5, 2022
d8332a7
refactor: Unified command options keys
devExcale Feb 6, 2022
ee2b3d0
fix: TrackIndex's next button not disabling on one page only
devExcale Feb 6, 2022
dbff7f3
refactor: Removed useless sout's
devExcale Feb 6, 2022
6f0fe65
refactor: Removed useless gets on CommandKeyword
devExcale Feb 6, 2022
9baaa17
other: added TODOs
devExcale Feb 6, 2022
f5b24a3
fix: Removed useless javafx import that made build fail
devExcale Feb 6, 2022
c5a71ad
Version upgrade (major)
devExcale Feb 6, 2022
4992d72
prove releases
Feb 6, 2022
37bd199
Reworked application for Java 25 and JDA 4
devExcale Apr 11, 2026
ff2ab29
ci: PR Validation, Release & Publish
devExcale Apr 12, 2026
756c848
refactor: Implement correctly lombok builder defaults (@Builder.Default)
devExcale Apr 12, 2026
94f6d4f
refactor: Update Maven configuration for compiler and remove unused S…
devExcale Apr 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: PR Validation

on:
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest

steps:

- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
cache: 'maven'

- name: Run Maven Tests
run: mvn clean test
54 changes: 54 additions & 0 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release & Publish

on:
pull_request:
types:
- closed
branches:
- master

jobs:
release:
if: github.event.pull_request.merged == true && github.head_ref == 'develop'
runs-on: ubuntu-latest

steps:

- name: Checkout master branch
uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.PAT_TOKEN }}

- name: Set up JDK 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
cache: 'maven'

- name: Remove SNAPSHOT from POM
id: bump_version
run: |
mvn versions:set -DremoveSnapshot=true -DgenerateBackupPoms=false
NEW_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV

- name: Commit and Push to Master
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -am "chore: release version ${{ env.VERSION }}"
git push origin master

- name: Package Application
# Tests are skipped because they already passed in the PR Validation workflow
run: mvn clean package -DskipTests

- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.VERSION }}
name: Release v${{ env.VERSION }}
files: target/*.jar
generate_release_notes: true
83 changes: 66 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,27 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.2</version>
<version>4.0.4</version>
<relativePath/>
</parent>

<groupId>ovh.excale</groupId>
<artifactId>vgreeter</artifactId>
<version>2.3.0</version>
<version>26.4.0-SNAPSHOT</version>

<name>VGreeter</name>
<description>Let the bot greet your friends when they join vocal chat on Discord!</description>
<url>https://github.com/devExcale/VGreeter</url>
<packaging>jar</packaging>

<scm>
<connection>scm:git:${project.url}</connection>
</scm>

<properties>
<java.version>1.8</java.version>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<java.version>25</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdave.version>0.1.8</jdave.version>
</properties>

<dependencies>
Expand All @@ -43,7 +46,27 @@
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>4.3.0_277</version>
<version>6.4.1</version>
</dependency>
<dependency>
<groupId>club.minnced</groupId>
<artifactId>jdave-api</artifactId>
<version>${jdave.version}</version>
</dependency>
<dependency>
<groupId>club.minnced</groupId>
<artifactId>jdave-native-win-x86-64</artifactId>
<version>${jdave.version}</version>
</dependency>
<dependency>
<groupId>club.minnced</groupId>
<artifactId>jdave-native-linux-x86-64</artifactId>
<version>${jdave.version}</version>
</dependency>
<dependency>
<groupId>club.minnced</groupId>
<artifactId>jdave-native-linux-aarch64</artifactId>
<version>${jdave.version}</version>
</dependency>

<!-- Opus processing -->
Expand All @@ -62,7 +85,12 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.5</version>
</dependency>

<!-- JSON parsing -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

<!-- Environment -->
Expand All @@ -76,18 +104,18 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.22</version>
<version>42.7.7</version>
</dependency>

</dependencies>
<!-- Better code -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.44</version>
<scope>provided</scope>
</dependency>

<repositories>
<repository>
<id>dv8tion</id>
<name>m2-dv8tion</name>
<url>https://m2.dv8tion.net/releases</url>
</repository>
</repositories>
</dependencies>

<build>
<finalName>${project.name}-${project.version}</finalName>
Expand All @@ -105,10 +133,31 @@

<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version>
<configuration>
<release>${java.version}</release>
<proc>full</proc>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.44</version>
</path>
<path>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>${project.parent.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.5.2</version>
</plugin>

</plugins>
Expand Down
57 changes: 49 additions & 8 deletions src/main/java/ovh/excale/vgreeter/VGreeterApplication.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ovh.excale.vgreeter;

import lombok.extern.log4j.Log4j2;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.Banner;
Expand All @@ -11,11 +11,14 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ConfigurableApplicationContext;

@Log4j2
@SpringBootApplication
public class VGreeterApplication implements CommandLineRunner, ApplicationContextAware {

private static ApplicationContext ctx;
private static Boolean maintenance;
private static ConfigurableApplicationContext ctx;

public static void main(String[] args) {

Expand All @@ -25,26 +28,64 @@ public static void main(String[] args) {

}

// TODO: DON'T CONNECT TO DB DURING MAINTENANCE

// keep previous maintenance state
public static void restart(@Nullable final Runnable then, @Nullable final Boolean maintenance) {

log.info("Restarting app");

Thread thread = new Thread(() -> {
ctx.close();

VGreeterApplication.maintenance = maintenance != null ? maintenance : VGreeterApplication.maintenance;

SpringApplication app = new SpringApplication(VGreeterApplication.class);
app.setBannerMode(Banner.Mode.OFF);
app.run();

if(then != null)
then.run();

});

thread.setDaemon(false);
thread.start();

}

public static void restart(@NotNull Runnable then) {
restart(then, null);
}

public static void restart(boolean maintenance) {
restart(null, maintenance);
}

public static boolean isInMaintenance() {
return maintenance;
}

public static ApplicationContext getApplicationContext() {
return ctx;
}

public final Logger logger;
public final String version;

public VGreeterApplication(@Value("${application.version}") String version) {
public VGreeterApplication(@Value("${application.version}") String version,
@Value("${env.MAINTENANCE:false}") boolean maintenance) {
this.version = version;
logger = LoggerFactory.getLogger(VGreeterApplication.class);
VGreeterApplication.maintenance = maintenance;
}

@Override
public void run(String[] args) {
logger.info("Running on version {}", version);
log.info("Running on version {}", version);
}

@Override
public void setApplicationContext(@NotNull ApplicationContext context) throws BeansException {
ctx = context;
ctx = (ConfigurableApplicationContext) context;
}

}
52 changes: 0 additions & 52 deletions src/main/java/ovh/excale/vgreeter/commands/AbstractCommand.java

This file was deleted.

Loading
Loading