Compare commits

...

29 Commits

Author SHA1 Message Date
release-bot
618155a464 [maven-release-plugin] prepare release v1.5.50 2024-11-05 22:15:12 +00:00
Sheldan
feabe6426e [AB-xxx] fixing version after failed release 2024-11-05 23:12:45 +01:00
Sheldan
2dc21ce996 [AB-xxx] fixing typescript linter warning 2024-11-05 23:11:42 +01:00
release-bot
5643a41fd8 [maven-release-plugin] prepare for next development iteration 2024-11-05 22:00:25 +00:00
release-bot
08d0561998 [maven-release-plugin] prepare release v1.5.49 2024-11-05 22:00:24 +00:00
Sheldan
879c1b0173 [AB-xxx] displaying more information on the external leaderboard 2024-11-05 22:57:51 +01:00
Sheldan
d5bf70f586 [AB-xxx] fixing variable naming 2024-11-04 23:14:16 +01:00
release-bot
4525fbc861 Commit from GitHub Actions (Publishes a new version of abstracto) 2024-10-29 21:53:24 +00:00
release-bot
4671a78ff9 [maven-release-plugin] prepare for next development iteration 2024-10-29 21:43:24 +00:00
release-bot
c4174562c6 [maven-release-plugin] prepare release v1.5.48 2024-10-29 21:43:22 +00:00
Sheldan
bfaa5d6140 [AB-xxx] making lovecalc deterministic (simple approach) 2024-10-29 22:36:04 +01:00
release-bot
d2e8398fa4 Commit from GitHub Actions (Publishes a new version of abstracto) 2024-09-29 19:56:51 +00:00
release-bot
c67209925a [maven-release-plugin] prepare for next development iteration 2024-09-29 19:46:50 +00:00
release-bot
f3ac7895eb [maven-release-plugin] prepare release v1.5.47 2024-09-29 19:46:48 +00:00
Sheldan
6d893e39bb [AB-xxx] downgrading to java 8 for liquibase 2024-09-29 21:44:28 +02:00
release-bot
94140104de Commit from GitHub Actions (Publishes a new version of abstracto) 2024-09-29 19:23:42 +00:00
release-bot
6d80423244 [maven-release-plugin] prepare for next development iteration 2024-09-29 19:13:23 +00:00
release-bot
27040e506a [maven-release-plugin] prepare release v1.5.46 2024-09-29 19:13:22 +00:00
Sheldan
3bbf5a2391 [AB-xxx] restructuring docker file for liquibase deployment to abide to the upload limits per individual file 2024-09-29 21:11:04 +02:00
release-bot
11cb3b9ee1 [maven-release-plugin] prepare for next development iteration 2024-09-29 09:36:43 +00:00
release-bot
dccf314e53 [maven-release-plugin] prepare release v1.5.45 2024-09-29 09:36:42 +00:00
Sheldan
a0daeee3a1 [AB-xxx] removing discord webhook due to deprecated github action 2024-09-29 11:30:28 +02:00
Sheldan
1b7c383ced [AB-xxx] allowing reminders to not have a text
code cleanup
2024-09-29 11:22:47 +02:00
release-bot
087dd266cc Commit from GitHub Actions (Publishes a new version of abstracto) 2024-08-06 20:59:49 +00:00
release-bot
beda17f672 [maven-release-plugin] prepare for next development iteration 2024-08-06 20:50:04 +00:00
release-bot
5c234295aa [maven-release-plugin] prepare release v1.5.44 2024-08-06 20:50:02 +00:00
Sheldan
9cfe4bf353 [AB-xxx] commit for release 2024-08-06 22:47:31 +02:00
release-bot
75c45541c9 [maven-release-plugin] prepare for next development iteration 2024-08-06 20:30:22 +00:00
release-bot
11ac33ad4a [maven-release-plugin] prepare release v1.5.43 2024-08-06 20:30:20 +00:00
97 changed files with 180 additions and 131 deletions

2
.env
View File

@@ -1,2 +1,2 @@
REGISTRY_PREFIX=harbor.sheldan.dev/abstracto/
VERSION=1.5.42
VERSION=1.5.49

View File

@@ -37,15 +37,4 @@ jobs:
- name: Build ui application
working-directory: ./ui/experience-tracking
run: npm run build
- uses: actions/setup-ruby@v1
- name: Send Webhook Notification
if: always()
env:
JOB_STATUS: ${{ job.status }}
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
HOOK_OS_NAME: ${{ runner.os }}
WORKFLOW_NAME: ${{ github.workflow }}
run: |
git clone https://github.com/DiscordHooks/github-actions-discord-webhook.git webhook
bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL
shell: bash

1
.gitignore vendored
View File

@@ -14,7 +14,6 @@ target/
# Package Files #
*.jar
*.war
*.nar
*.zip
*.tar.gz

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>anti-raid</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>anti-raid</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>abstracto-modules</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>assignable-roles</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>assignable-roles</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>assignable-roles-int</artifactId>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>abstracto-modules</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>custom-command</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>custom-command</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>abstracto-modules</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>dynamic-activity</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>dynamic-activity</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>abstracto-modules</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>entertainment</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -105,7 +105,9 @@ public class EntertainmentServiceBean implements EntertainmentService {
@Override
public Integer getLoveCalcValue(String firstPart, String secondPart) {
return secureRandom.nextInt(100);
String fullInput = firstPart.toLowerCase() + secondPart.toLowerCase();
Random random = new Random(fullInput.hashCode());
return random.nextInt(100);
}
@Override

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>entertainment</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>abstracto-modules</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>experience-tracking</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -8,6 +8,7 @@ import dev.sheldan.abstracto.core.service.management.ServerManagementService;
import dev.sheldan.abstracto.experience.model.api.UserExperienceDisplay;
import dev.sheldan.abstracto.experience.model.database.AExperienceRole;
import dev.sheldan.abstracto.experience.model.database.AUserExperience;
import dev.sheldan.abstracto.experience.service.ExperienceLevelService;
import dev.sheldan.abstracto.experience.service.management.UserExperienceManagementService;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Member;
@@ -37,6 +38,9 @@ public class LeaderboardController {
@Autowired
private GuildService guildService;
@Autowired
private ExperienceLevelService experienceLevelService;
@GetMapping(value = "/leaderboards/{serverId}", produces = "application/json")
public Page<UserExperienceDisplay> getLeaderboard(@PathVariable("serverId") Long serverId,
@PageableDefault(value = 25, page = 0)
@@ -55,6 +59,8 @@ public class LeaderboardController {
AExperienceRole experienceRole = aUserExperience.getCurrentExperienceRole();
UserDisplay userDisplay = null;
RoleDisplay roleDisplay = null;
Long experienceNeededToNextLevel = experienceLevelService.calculateExperienceToNextLevel(aUserExperience.getCurrentLevel().getLevel(), aUserExperience.getExperience());
Long nextLevelExperience = experienceLevelService.calculateNextLevel(aUserExperience.getCurrentLevel().getLevel()).getExperienceNeeded();
if(experienceRole != null) {
Role role = guild.getRoleById(experienceRole.getRole().getId());
if(role != null) {
@@ -66,6 +72,9 @@ public class LeaderboardController {
if(member != null) {
userDisplay = UserDisplay.fromMember(member);
}
Long currentExpNeeded = aUserExperience.getCurrentLevel().getExperienceNeeded();
Long experienceWithinLevel = aUserExperience.getExperience() - currentExpNeeded;
Long experienceNeededForCurrentLevel = nextLevelExperience - currentExpNeeded;
return UserExperienceDisplay
.builder()
.id(String.valueOf(userId))
@@ -73,6 +82,11 @@ public class LeaderboardController {
.level(aUserExperience.getLevelOrDefault())
.rank((int) pageable.getOffset() + page.getContent().indexOf(aUserExperience) + 1)
.experience(aUserExperience.getExperience())
.experienceToNextLevel(experienceNeededToNextLevel)
.currentLevelExperienceNeeded(experienceNeededForCurrentLevel)
.experienceOnCurrentLevel(experienceWithinLevel)
.percentage(((float) experienceWithinLevel / experienceNeededForCurrentLevel) * 100)
.nextLevelExperienceNeeded(nextLevelExperience)
.role(roleDisplay)
.member(userDisplay)
.build();

View File

@@ -107,13 +107,13 @@ public class Rank extends AbstractConditionableCommand {
Long currentExpNeeded = experienceObj.getCurrentLevel().getExperienceNeeded();
Long experienceNeededToNextLevel = experienceLevelService.calculateExperienceToNextLevel(experienceObj.getCurrentLevel().getLevel(), experienceObj.getExperience());
Long nextLevelExperience = experienceLevelService.calculateNextLevel(experienceObj.getCurrentLevel().getLevel()).getExperienceNeeded();
Long levelExperience = nextLevelExperience - currentExpNeeded;
Long inLevelExperience = experienceObj.getExperience() - currentExpNeeded;
Long experienceNeededForCurrentLevel = nextLevelExperience - currentExpNeeded;
Long experienceWithinLevel = experienceObj.getExperience() - currentExpNeeded;
rankModel.setExperienceForCurrentLevel(currentExpNeeded);
rankModel.setCurrentLevelPercentage(((float) inLevelExperience / levelExperience) * 100);
rankModel.setLevelExperience(levelExperience);
rankModel.setCurrentLevelPercentage(((float) experienceWithinLevel / experienceNeededForCurrentLevel) * 100);
rankModel.setLevelExperience(experienceNeededForCurrentLevel);
rankModel.setExperienceToNextLevel(experienceNeededToNextLevel);
rankModel.setInLevelExperience(inLevelExperience);
rankModel.setInLevelExperience(experienceWithinLevel);
rankModel.setNextLevelExperience(nextLevelExperience);
return templateService.renderEmbedTemplate(RANK_POST_EMBED_TEMPLATE, rankModel, toRender.getGuild().getIdLong());
}

View File

@@ -16,4 +16,9 @@ public class UserExperienceDisplay {
private Long experience;
private Long messages;
private RoleDisplay role;
private Long experienceToNextLevel;
private Long experienceOnCurrentLevel;
private Long currentLevelExperienceNeeded;
private Float percentage;
private Long nextLevelExperienceNeeded;
}

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>experience-tracking</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>abstracto-modules</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>giveaway</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<artifactId>giveaway-impl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>giveaway</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<artifactId>giveaway-int</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>abstracto-modules</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<artifactId>giveaway</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<artifactId>image-generation</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<artifactId>image-generation-impl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<artifactId>image-generation</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<artifactId>image-generation-int</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>abstracto-modules</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<artifactId>image-generation</artifactId>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>invite-filter</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>invite-filter</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -18,7 +18,7 @@
<dependency>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>moderation-int</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
<scope>compile</scope>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>abstracto-modules</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>link-embed</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>link-embed</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>abstracto-modules</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>logging</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>logging</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>abstracto-modules</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>moderation</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>moderation</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>abstracto-modules</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>modmail</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>modmail</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>abstracto-modules</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto</groupId>
<artifactId>abstracto-application</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>abstracto-modules</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>profanity-filter</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>profanity-filter</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>abstracto-modules</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>remind</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -77,7 +77,10 @@ public class Remind extends AbstractConditionableCommand {
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
List<Object> parameters = commandContext.getParameters().getParameters();
Duration remindTime = (Duration) parameters.get(0);
String text = (String) parameters.get(1);
String text = null;
if(parameters.size() > 1) {
text = (String) parameters.get(1);
}
Long serverId = commandContext.getGuild().getIdLong();
AUserInAServer aUserInAServer = userInServerManagementService.loadOrCreateUser(commandContext.getAuthor());
Reminder createdReminder = remindService.createReminderInForUser(aUserInAServer, text, remindTime, commandContext.getMessage());
@@ -110,8 +113,11 @@ public class Remind extends AbstractConditionableCommand {
public CompletableFuture<CommandResult> executeSlash(SlashCommandInteractionEvent event) {
String durationString = slashCommandParameterService.getCommandOption(DURATION_PARAMETER, event, Duration.class, String.class);
Duration duration = ParseUtils.parseDuration(durationString);
String reminderText = slashCommandParameterService.getCommandOption(REMIND_TEXT_PARAMETER, event, String.class, String.class);
String reminderText = null;
Long serverId = event.getGuild().getIdLong();
if(slashCommandParameterService.hasCommandOption(REMIND_TEXT_PARAMETER, event)) {
reminderText = slashCommandParameterService.getCommandOption(REMIND_TEXT_PARAMETER, event, String.class, String.class);
}
AUserInAServer aUserInAServer = userInServerManagementService.loadOrCreateUser(event.getMember());
Long snowFlake = SnowflakeUtils.createSnowFlake();
String joinButtonId = componentService.generateComponentId();
@@ -152,6 +158,7 @@ public class Remind extends AbstractConditionableCommand {
.name(REMIND_TEXT_PARAMETER)
.type(String.class)
.templated(true)
.optional(true)
.remainder(true)
.build();
List<Parameter> parameters = Arrays.asList(durationParameter, remindTextParameter);

View File

@@ -38,11 +38,6 @@ public class ReminderManagementServiceBean implements ReminderManagementService
return reminderRepository.save(reminder);
}
@Override
public Reminder createReminder(AServerAChannelAUser userToBeReminded, String text, Instant timeToBeRemindedAt) {
return null;
}
@Override
public Optional<Reminder> loadReminderOptional(Long reminderId) {
return reminderRepository.findById(reminderId);

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>remind</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -10,7 +10,6 @@ import java.util.Optional;
public interface ReminderManagementService {
Reminder createReminder(AServerAChannelAUser userToBeReminded, String text, Instant timeToBeRemindedAt, Long messageId);
Reminder createReminder(AServerAChannelAUser userToBeReminded, String text, Instant timeToBeRemindedAt);
Optional<Reminder> loadReminderOptional(Long reminderId);
Reminder loadReminder(Long reminderId);
void setReminded(Reminder reminder);

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>abstracto-modules</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>repost-detection</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>repost-detection</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>abstracto-modules</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>starboard</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>starboard</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>abstracto-modules</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>statistic</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>statistic</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>abstracto-modules</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>sticky-roles</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<artifactId>sticky-roles-impl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>sticky-roles</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<artifactId>sticky-roles-int</artifactId>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>abstracto-modules</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>suggestion</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>suggestion</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>abstracto-modules</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>twitch</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>twitch</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>abstracto-modules</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>utility</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>utility</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>abstracto-modules</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>voice-channel-context</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>voice-channel-context</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>abstracto-modules</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>webservices</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.modules</groupId>
<artifactId>webservices</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto</groupId>
<artifactId>abstracto-application</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.core</groupId>
<artifactId>core</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.core</groupId>
<artifactId>core</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>core</artifactId>
<groupId>dev.sheldan.abstracto.core</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>core</artifactId>
<groupId>dev.sheldan.abstracto.core</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto</groupId>
<artifactId>abstracto-application</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<artifactId>abstracto-application</artifactId>
<groupId>dev.sheldan.abstracto</groupId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -10,7 +10,7 @@
<groupId>dev.sheldan.abstracto</groupId>
<artifactId>abstracto-application</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
<packaging>pom</packaging>
<modules>
@@ -33,7 +33,7 @@
<connection>scm:git:${project.scm.url}</connection>
<developerConnection>scm:git:${project.scm.url}</developerConnection>
<url>https://github.com/Sheldan/abstracto.git</url>
<tag>HEAD</tag>
<tag>v1.5.50</tag>
</scm>
<repositories>
@@ -69,17 +69,18 @@
<mockito-core.version>5.4.0</mockito-core.version>
<commons-collections.version>4.4</commons-collections.version>
<spring-boot-starter.version>3.1.1</spring-boot-starter.version>
<prometheus.client.version>0.16.0</prometheus.client.version>
<prometheus-client.version>0.16.0</prometheus-client.version>
<junit.version>4.13.1</junit.version>
<micrometer.prometheus.version>1.11.1</micrometer.prometheus.version>
<google.api.client.version>1.31.3</google.api.client.version>
<google.api.youtube.version>v3-rev222-1.25.0</google.api.youtube.version>
<everit.json.schema.version>1.12.2</everit.json.schema.version>
<micrometer-prometheus.version>1.11.1</micrometer-prometheus.version>
<google-api-client.version>1.31.3</google-api-client.version>
<google-api-youtube.version>v3-rev222-1.25.0</google-api-youtube.version>
<everit-json-schema.version>1.12.2</everit-json-schema.version>
<twitch4j.version>1.15.0</twitch4j.version>
<!-- required by twitch4j -->
<jackson.version>2.15.2</jackson.version>
<ehcache.version>3.10.8</ehcache.version>
<hibernate-jcache.version>6.2.5.Final</hibernate-jcache.version>
<javax-annotation-api.version>1.3.2</javax-annotation-api.version>
</properties>
<build>
@@ -245,30 +246,30 @@
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient</artifactId>
<version>${prometheus.client.version}</version>
<version>${prometheus-client.version}</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>${micrometer.prometheus.version}</version>
<version>${micrometer-prometheus.version}</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>${google.api.client.version}</version>
<version>${google-api-client.version}</version>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-youtube</artifactId>
<version>${google.api.youtube.version}</version>
<version>${google-api-youtube.version}</version>
</dependency>
<dependency>
<groupId>com.github.everit-org.json-schema</groupId>
<artifactId>org.everit.json.schema</artifactId>
<version>${everit.json.schema.version}</version>
<version>${everit-json-schema.version}</version>
</dependency>
<dependency>
@@ -280,7 +281,7 @@
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
<version>${javax-annotation-api.version}</version>
</dependency>
</dependencies>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto</groupId>
<artifactId>abstracto-application</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.scheduling</groupId>
<artifactId>scheduling</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>

View File

@@ -3,7 +3,7 @@
<parent>
<groupId>dev.sheldan.abstracto.scheduling</groupId>
<artifactId>scheduling</artifactId>
<version>1.5.43-SNAPSHOT</version>
<version>1.5.50</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>

View File

@@ -12,11 +12,16 @@ RUN apt-get update \
# Install liquibase
RUN mkdir -p /liqiubase \
&& wget -nv https://github.com/liquibase/liquibase/releases/download/v${liquibase_version}/liquibase-${liquibase_version}.zip -O /tmp/liquibase.zip \
&& unzip /tmp/liquibase.zip -d /liquibase
&& unzip /tmp/liquibase.zip -d /liquibase \
# Split copying to workaround upload limits (increases amount of layers)
&& mv /liquibase/internal/lib/snowflake-jdbc.jar /liquibase-internal-lib-snowflake-jdbc.jar \
&& mv /liquibase/internal/lib /liquibase-internal-lib
RUN mkdir -p /java \
&& wget -nv https://corretto.aws/downloads/latest/amazon-corretto-8-x64-linux-jdk.tar.gz -O /tmp/java.tar.gz \
&& tar -xf /tmp/java.tar.gz --strip-components=1 -C /java
&& tar -xf /tmp/java.tar.gz --strip-components=1 -C /java \
&& mv /java/jre /java-jre \
&& mv /java/src.zip /java-src.zip
# Install postgres driver
RUN mkdir -p /postgres \
@@ -37,8 +42,12 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install --no-cache-dir psycopg2-binary==${psycopg2_version} SQLAlchemy==${sql_alchemy_version} jinja2==${jinja_version}
COPY --from=base /liquibase /liquibase
COPY --from=base /liquibase-internal-lib /liquibase/internal/lib
COPY --from=base /liquibase-internal-lib-snowflake-jdbc.jar /liquibase/internal/lib/snowflake-jdbc.jar
COPY --from=base /postgres /postgres
COPY --from=base /java /java
COPY --from=base /java-jre /java/jre
COPY --from=base /java-src.zip /java/src.zip
ENV JAVA_HOME=/java/jre
ADD python /python
ADD wrapper /

View File

@@ -13,9 +13,32 @@ export const LeaderboardEntry = ({member, index}: { member: ExperienceMember, in
<span className="inline-flex items-center h-16">
{member.id.toString()}
</span>;
function getDisplayPercentage() {
let increased = member.percentage * 100;
if(increased % 100 === 0) {
return Math.trunc(increased / 100)
} else {
return Math.trunc(increased) / 100;
}
}
function getPercentageDisplay() {
return `${member.experienceOnCurrentLevel.toLocaleString()}/${member.currentLevelExperienceNeeded.toLocaleString()} (${getDisplayPercentage()}%)`
}
let memberDetail = <tr>
<td colSpan={5}>
<div className={`bg-slate-700`}>
<div className={`${index % 2 === 0 ? "bg-gray-600" : "bg-gray-800"} text-center`} style={{width: getDisplayPercentage() + '%'}}>
<span style={{color: nameColor, whiteSpace: "nowrap"}}>{getPercentageDisplay()}</span>
</div>
</div>
</td>
</tr>;
return (
<>
<tr className={`${index % 2 === 0 ? "bg-gray-600" : "bg-gray-800"} h-full`} style={{ minHeight: 64}}>
<tr className={`${index % 2 === 0 ? "bg-gray-600" : "bg-gray-800"} h-full`} style={{minHeight: 64}}>
<td
className="text-center">
{member.rank}
@@ -23,16 +46,17 @@ export const LeaderboardEntry = ({member, index}: { member: ExperienceMember, in
<td className="px-2 py-3 font-medium whitespace-nowrap text-white flex items-center gap-2">
{memberDisplay}
</td>
<td className="px-1 py-3 text-center">
<td className="px-1 py-3 text-center" style={{color: nameColor}}>
{member.experience.toLocaleString()}
</td>
<td className="px-1 py-3 text-center">
<td className="px-1 py-3 text-center" style={{color: nameColor}}>
{member.messages.toLocaleString()}
</td>
<td className="px-2 py-3 text-center">
<td className="px-2 py-3 text-center" style={{color: nameColor}}>
{member.level.toString()}
</td>
</tr>
{memberDetail}
</>
);

View File

@@ -6,6 +6,11 @@ export interface ExperienceMember {
messages: bigint;
member: Member | null;
role: Role | null;
experienceToNextLevel: number;
experienceOnCurrentLevel: number;
percentage: number;
nextLevelExperienceNeeded: number;
currentLevelExperienceNeeded: number;
}
export interface Member {