Skip to content
Open
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
6 changes: 0 additions & 6 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,11 @@
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
Expand Down
29 changes: 18 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.5</version>
<relativePath/> <!-- lookup parent from repository -->
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>net.foxgenesis</groupId>
<artifactId>customjail</artifactId>
<version>0.1.0</version>
<name>Custom Jail</name>
<description>Demo project for Spring Boot</description>
<url/>
<url />
<licenses>
<license/>
<license />
</licenses>
<developers>
<developer/>
<developer />
</developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
<connection />
<developerConnection />
<tag />
<url />
</scm>
<properties>
<java.version>17</java.version>
Expand All @@ -34,13 +35,13 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>

<dependency>
<groupId>net.foxgenesis</groupId>
<artifactId>watame</artifactId>
<version>0.1.0</version>
</dependency>

<dependency>
<groupId>net.foxgenesis</groupId>
<artifactId>role-storage</artifactId>
Expand All @@ -58,5 +59,11 @@
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
</project>
41 changes: 41 additions & 0 deletions src/main/java/net/foxgenesis/customjail/CommonMessages.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package net.foxgenesis.customjail;

import java.util.Objects;

import org.springframework.context.MessageSourceResolvable;

public enum CommonMessages implements MessageSourceResolvable {
MEMBER("customjail.embed.member"),
MODERATOR("customjail.embed.moderator"),
ANONYMOUS("customjail.anonymous"),
ACCEPT("customjail.embed.accept"),
ACCEPTED("customjail.embed.accepted"),
YES("customjail.embed.yes"),
NO("customjail.embed.no"),
REASON("customjail.embed.reason"),
DEFAULT_REASON("customjail.embed.defaultReason"),
WARNING_LEVEL("customjail.embed.warning-level"),
TOTAL_WARNINGS("customjail.embed.total-warnings"),
WARNING_EXPIRES("customjail.embed.warning-expires"),
WITH_WARNING("customjail.embed.with-warning"),
NA("customjail.embed.na"),
CASE_ID("customjail.embed.caseid"),
DURATION("customjail.embed.duration"),
TIME_LEFT("customjail.embed.time-left"),
JAIL_DETAILS("customjail.container.jaildetails"),
UNJAIL("customjail.embed.unjail"),
FORCESTART("customjail.embed.forcestart"),
MEMBER_JAILED("customjail.embed.jailed");

private final String[] codes;

CommonMessages(String code) {
this.codes = new String[] { Objects.requireNonNull(code) };
}

@Override
public String[] getCodes() {
return codes;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import net.dv8tion.jda.api.Permission;
import net.dv8tion.jda.api.interactions.DiscordLocale;
import net.dv8tion.jda.api.interactions.InteractionContextType;
import net.dv8tion.jda.api.interactions.commands.Command;
import net.dv8tion.jda.api.interactions.commands.Command.Choice;
import net.dv8tion.jda.api.interactions.commands.DefaultMemberPermissions;
Expand Down Expand Up @@ -194,7 +195,7 @@ private static CommandData user(String id, DefaultMemberPermissions permissions,
LocalizationFunction localization) {
return Commands.user(id)
// Set guild only
.setGuildOnly(true)
.setContexts(InteractionContextType.GUILD)
// Set default permissions
.setDefaultPermissions(permissions)
// Set localization
Expand All @@ -205,7 +206,7 @@ private static SlashCommandData slash(String id, String description, DefaultMemb
LocalizationFunction localization) {
return Commands.slash(id, description)
// Set guild only
.setGuildOnly(true)
.setContexts(InteractionContextType.GUILD)
// Set default permissions
.setDefaultPermissions(permissions)
// Set localization
Expand Down
Loading