Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 8 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.eggy03</groupId>
<artifactId>papertrailbot</artifactId>
<version>4.1.0</version>
<version>4.1.1</version>
<name>PaperTrail Bot</name>
<description>A simple bot for logging all server and member actions</description>
<packaging>quarkus</packaging>
Expand All @@ -23,7 +23,7 @@

<!-- Dependency Versions -->
<jda.version>6.4.1</jda.version>
<papertrail.sdk.version>2.0.5</papertrail.sdk.version>
<papertrail.sdk.version>3.0.0</papertrail.sdk.version>
<commons-lang3.version>3.20.0</commons-lang3.version>
<guava.version>33.5.0-jre</guava.version>
<jetbrains.annotations.version>26.1.0</jetbrains.annotations.version>
Expand Down Expand Up @@ -54,6 +54,12 @@
<artifactId>quarkus-arc</artifactId>
</dependency>

<!-- Jackson -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jackson</artifactId>
</dependency>

<!-- Health -->
<dependency>
<groupId>io.quarkus</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.eggy03.papertrail.bot.bean;

import com.fasterxml.jackson.databind.ObjectMapper;
import io.github.eggy03.papertrail.sdk.client.AuditLogRegistrationClient;
import io.github.eggy03.papertrail.sdk.client.MessageLogContentClient;
import io.github.eggy03.papertrail.sdk.client.MessageLogRegistrationClient;
Expand All @@ -14,30 +15,32 @@
public final class PaperTrailSdkBeanProvider {

private final @NonNull String apiUrl;
private final @NonNull ObjectMapper objectMapper;

@Inject
public PaperTrailSdkBeanProvider(@ConfigProperty(name = "api.url") @NonNull String apiUrl) {
public PaperTrailSdkBeanProvider(@ConfigProperty(name = "api.url") @NonNull String apiUrl, @NonNull ObjectMapper objectMapper) {
this.apiUrl = apiUrl;
this.objectMapper = objectMapper;
}

@Contract(" -> new")
@Produces
@ApplicationScoped
public @NonNull AuditLogRegistrationClient auditLogRegistrationClient() {
return new AuditLogRegistrationClient(apiUrl);
return new AuditLogRegistrationClient(apiUrl, objectMapper);
}

@Contract(" -> new")
@Produces
@ApplicationScoped
public @NonNull MessageLogRegistrationClient messageLogRegistrationClient() {
return new MessageLogRegistrationClient(apiUrl);
return new MessageLogRegistrationClient(apiUrl, objectMapper);
}

@Contract(" -> new")
@Produces
@ApplicationScoped
public @NonNull MessageLogContentClient messageLogContentClient() {
return new MessageLogContentClient(apiUrl);
return new MessageLogContentClient(apiUrl, objectMapper);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public final class ProjectInfo {
public static final String APPNAME = "PaperTrail";

@NonNull
public static final String VERSION = "v4.1.0";
public static final String VERSION = "v4.1.1";

@NonNull
public static final String PROJECT_ISSUE_LINK = "https://github.com/eggy03/PaperTrailBot/issues";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.eggy03.papertrail.bot.handlers.auditlog;

import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventHandler;
import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventActionTypeHandler;
import io.github.eggy03.papertrail.bot.utils.BooleanUtils;
import io.github.eggy03.papertrail.bot.utils.auditlog.AutoModUtils;
import io.github.eggy03.papertrail.sdk.client.AuditLogRegistrationClient;
Expand All @@ -23,12 +23,12 @@
@ApplicationScoped
@Slf4j
@SuppressWarnings("java:S1192")
public final class AutoModEventHandler extends GuildAuditLogEntryCreateEventHandler {
public final class AutoModActionTypeHandler extends GuildAuditLogEntryCreateEventActionTypeHandler {

private final @NonNull AuditLogRegistrationClient client;

@Inject
public AutoModEventHandler(@NonNull AuditLogRegistrationClient client) {
public AutoModActionTypeHandler(@NonNull AuditLogRegistrationClient client) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.eggy03.papertrail.bot.handlers.auditlog;

import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventHandler;
import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventActionTypeHandler;
import io.github.eggy03.papertrail.bot.utils.BooleanUtils;
import io.github.eggy03.papertrail.bot.utils.DurationUtils;
import io.github.eggy03.papertrail.bot.utils.auditlog.ChannelUtils;
Expand All @@ -24,12 +24,12 @@
@ApplicationScoped
@Slf4j
@SuppressWarnings("java:S1192")
public final class ChannelEventHandler extends GuildAuditLogEntryCreateEventHandler {
public final class ChannelActionTypeHandler extends GuildAuditLogEntryCreateEventActionTypeHandler {

private final @NonNull AuditLogRegistrationClient client;

@Inject
public ChannelEventHandler(@NonNull AuditLogRegistrationClient client) {
public ChannelActionTypeHandler(@NonNull AuditLogRegistrationClient client) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.eggy03.papertrail.bot.handlers.auditlog;

import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventHandler;
import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventActionTypeHandler;
import io.github.eggy03.papertrail.bot.utils.auditlog.ChannelUtils;
import io.github.eggy03.papertrail.sdk.client.AuditLogRegistrationClient;
import io.github.eggy03.papertrail.sdk.entity.AuditLogRegistrationEntity;
Expand All @@ -24,12 +24,12 @@
@ApplicationScoped
@Slf4j
@SuppressWarnings("java:S1192")
public final class ChannelOverrideEventHandler extends GuildAuditLogEntryCreateEventHandler {
public final class ChannelOverrideActionTypeHandler extends GuildAuditLogEntryCreateEventActionTypeHandler {

private final @NonNull AuditLogRegistrationClient client;

@Inject
public ChannelOverrideEventHandler(@NonNull AuditLogRegistrationClient client) {
public ChannelOverrideActionTypeHandler(@NonNull AuditLogRegistrationClient client) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.eggy03.papertrail.bot.handlers.auditlog;

import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventHandler;
import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventActionTypeHandler;
import io.github.eggy03.papertrail.sdk.client.AuditLogRegistrationClient;
import io.github.eggy03.papertrail.sdk.entity.AuditLogRegistrationEntity;
import jakarta.enterprise.context.ApplicationScoped;
Expand All @@ -20,12 +20,12 @@
@ApplicationScoped
@Slf4j
@SuppressWarnings("java:S1192")
public final class EmojiEventHandler extends GuildAuditLogEntryCreateEventHandler {
public final class EmojiActionTypeHandler extends GuildAuditLogEntryCreateEventActionTypeHandler {

private final @NonNull AuditLogRegistrationClient client;

@Inject
public EmojiEventHandler(@NonNull AuditLogRegistrationClient client) {
public EmojiActionTypeHandler(@NonNull AuditLogRegistrationClient client) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.eggy03.papertrail.bot.handlers.auditlog;

import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventHandler;
import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventActionTypeHandler;
import io.github.eggy03.papertrail.bot.utils.BooleanUtils;
import io.github.eggy03.papertrail.bot.utils.DurationUtils;
import io.github.eggy03.papertrail.bot.utils.auditlog.GuildUtils;
Expand All @@ -23,12 +23,12 @@
@ApplicationScoped
@Slf4j
@SuppressWarnings("java:S1192")
public final class GuildUpdateEventHandler extends GuildAuditLogEntryCreateEventHandler {
public final class GuildUpdateActionTypeHandler extends GuildAuditLogEntryCreateEventActionTypeHandler {

private final @NonNull AuditLogRegistrationClient client;

@Inject
public GuildUpdateEventHandler(@NonNull AuditLogRegistrationClient client) {
public GuildUpdateActionTypeHandler(@NonNull AuditLogRegistrationClient client) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.eggy03.papertrail.bot.handlers.auditlog;

import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventHandler;
import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventActionTypeHandler;
import io.github.eggy03.papertrail.sdk.client.AuditLogRegistrationClient;
import io.github.eggy03.papertrail.sdk.entity.AuditLogRegistrationEntity;
import jakarta.enterprise.context.ApplicationScoped;
Expand All @@ -20,12 +20,12 @@
@ApplicationScoped
@Slf4j
@SuppressWarnings("java:S1192")
public final class HomeSettingsEventHandler extends GuildAuditLogEntryCreateEventHandler {
public final class HomeSettingsActionTypeHandler extends GuildAuditLogEntryCreateEventActionTypeHandler {

private final @NonNull AuditLogRegistrationClient client;

@Inject
public HomeSettingsEventHandler(@NonNull AuditLogRegistrationClient client) {
public HomeSettingsActionTypeHandler(@NonNull AuditLogRegistrationClient client) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.eggy03.papertrail.bot.handlers.auditlog;

import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventHandler;
import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventActionTypeHandler;
import io.github.eggy03.papertrail.sdk.client.AuditLogRegistrationClient;
import io.github.eggy03.papertrail.sdk.entity.AuditLogRegistrationEntity;
import jakarta.enterprise.context.ApplicationScoped;
Expand All @@ -20,12 +20,12 @@
@ApplicationScoped
@Slf4j
@SuppressWarnings("java:S1192")
public final class IntegrationEventHandler extends GuildAuditLogEntryCreateEventHandler {
public final class IntegrationActionTypeHandler extends GuildAuditLogEntryCreateEventActionTypeHandler {

private final @NonNull AuditLogRegistrationClient client;

@Inject
public IntegrationEventHandler(@NonNull AuditLogRegistrationClient client) {
public IntegrationActionTypeHandler(@NonNull AuditLogRegistrationClient client) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.eggy03.papertrail.bot.handlers.auditlog;

import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventHandler;
import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventActionTypeHandler;
import io.github.eggy03.papertrail.bot.utils.BooleanUtils;
import io.github.eggy03.papertrail.bot.utils.DurationUtils;
import io.github.eggy03.papertrail.bot.utils.auditlog.InviteUtils;
Expand All @@ -23,12 +23,12 @@
@ApplicationScoped
@Slf4j
@SuppressWarnings("java:S1192")
public final class InviteEventHandler extends GuildAuditLogEntryCreateEventHandler {
public final class InviteActionTypeHandler extends GuildAuditLogEntryCreateEventActionTypeHandler {

private final @NonNull AuditLogRegistrationClient client;

@Inject
public InviteEventHandler(@NonNull AuditLogRegistrationClient client) {
public InviteActionTypeHandler(@NonNull AuditLogRegistrationClient client) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.eggy03.papertrail.bot.handlers.auditlog;

import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventHandler;
import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventActionTypeHandler;
import io.github.eggy03.papertrail.bot.utils.BooleanUtils;
import io.github.eggy03.papertrail.bot.utils.DurationUtils;
import io.github.eggy03.papertrail.bot.utils.auditlog.MemberUtils;
Expand All @@ -23,12 +23,12 @@
@ApplicationScoped
@Slf4j
@SuppressWarnings("java:S1192")
public final class MemberStatusEventHandler extends GuildAuditLogEntryCreateEventHandler {
public final class MemberUpdateActionTypeHandler extends GuildAuditLogEntryCreateEventActionTypeHandler {

private final @NonNull AuditLogRegistrationClient client;

@Inject
public MemberStatusEventHandler(@NonNull AuditLogRegistrationClient client) {
public MemberUpdateActionTypeHandler(@NonNull AuditLogRegistrationClient client) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.eggy03.papertrail.bot.handlers.auditlog;

import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventHandler;
import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventActionTypeHandler;
import io.github.eggy03.papertrail.sdk.client.AuditLogRegistrationClient;
import io.github.eggy03.papertrail.sdk.entity.AuditLogRegistrationEntity;
import jakarta.enterprise.context.ApplicationScoped;
Expand All @@ -20,12 +20,12 @@
@ApplicationScoped
@Slf4j
@SuppressWarnings("java:S1192")
public final class MessageEventHandler extends GuildAuditLogEntryCreateEventHandler {
public final class MessageActionTypeHandler extends GuildAuditLogEntryCreateEventActionTypeHandler {

private final @NonNull AuditLogRegistrationClient client;

@Inject
public MessageEventHandler(@NonNull AuditLogRegistrationClient client) {
public MessageActionTypeHandler(@NonNull AuditLogRegistrationClient client) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.eggy03.papertrail.bot.handlers.auditlog;

import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventHandler;
import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventActionTypeHandler;
import io.github.eggy03.papertrail.bot.utils.auditlog.MessageUtils;
import io.github.eggy03.papertrail.sdk.client.AuditLogRegistrationClient;
import io.github.eggy03.papertrail.sdk.entity.AuditLogRegistrationEntity;
Expand All @@ -21,12 +21,12 @@
@ApplicationScoped
@Slf4j
@SuppressWarnings("java:S1192")
public final class MessagePinEventHandler extends GuildAuditLogEntryCreateEventHandler {
public final class MessagePinActionTypeHandler extends GuildAuditLogEntryCreateEventActionTypeHandler {

private final @NonNull AuditLogRegistrationClient client;

@Inject
public MessagePinEventHandler(@NonNull AuditLogRegistrationClient client) {
public MessagePinActionTypeHandler(@NonNull AuditLogRegistrationClient client) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.eggy03.papertrail.bot.handlers.auditlog;

import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventHandler;
import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventActionTypeHandler;
import io.github.eggy03.papertrail.sdk.client.AuditLogRegistrationClient;
import io.github.eggy03.papertrail.sdk.entity.AuditLogRegistrationEntity;
import jakarta.enterprise.context.ApplicationScoped;
Expand All @@ -20,12 +20,12 @@
@ApplicationScoped
@Slf4j
@SuppressWarnings("java:S1192")
public final class ModActionEventHandler extends GuildAuditLogEntryCreateEventHandler {
public final class ModActionActionTypeHandler extends GuildAuditLogEntryCreateEventActionTypeHandler {

private final @NonNull AuditLogRegistrationClient client;

@Inject
public ModActionEventHandler(@NonNull AuditLogRegistrationClient client) {
public ModActionActionTypeHandler(@NonNull AuditLogRegistrationClient client) {
this.client = client;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.eggy03.papertrail.bot.handlers.auditlog;

import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventHandler;
import io.github.eggy03.papertrail.bot.listeners.auditlog.GuildAuditLogEntryCreateEventActionTypeHandler;
import io.github.eggy03.papertrail.bot.utils.BooleanUtils;
import io.github.eggy03.papertrail.bot.utils.auditlog.OnboardingUtils;
import io.github.eggy03.papertrail.sdk.client.AuditLogRegistrationClient;
Expand All @@ -23,12 +23,12 @@
@ApplicationScoped
@Slf4j
@SuppressWarnings("java:S1192")
public final class OnboardingEventHandler extends GuildAuditLogEntryCreateEventHandler {
public final class OnboardingActionTypeHandler extends GuildAuditLogEntryCreateEventActionTypeHandler {

private final @NonNull AuditLogRegistrationClient client;

@Inject
public OnboardingEventHandler(@NonNull AuditLogRegistrationClient client) {
public OnboardingActionTypeHandler(@NonNull AuditLogRegistrationClient client) {
this.client = client;
}

Expand Down
Loading
Loading