Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit 86b98af

Browse files
CodeDoctorDECodeDoctorDE
andauthored
fix prefix command, change command handle (#15)
Co-authored-by: CodeDoctorDE <[email protected]>
1 parent 64c15f0 commit 86b98af

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
![Build Status](https://ci.codemc.io/job/CodeDoctorDE/job/Linwood/badge/icon)
12
# Linwood
23
Java bot with many features. Developed by @CodeDoctorDE (Discord: CodeDoctor#8719)
34

pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.github.codedoctorde</groupId>
88
<artifactId>linwood</artifactId>
9-
<version>1.0</version>
9+
<version>1.0.1</version>
1010
<properties>
1111
<java.version>11</java.version>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -174,6 +174,12 @@
174174
<artifactId>icu4j</artifactId>
175175
<version>67.1</version>
176176
</dependency>
177+
<!-- https://mvnrepository.com/artifact/org.apache.ant/ant -->
178+
<dependency>
179+
<groupId>org.apache.ant</groupId>
180+
<artifactId>ant</artifactId>
181+
<version>1.10.8</version>
182+
</dependency>
177183
</dependencies>
178184
<distributionManagement>
179185
<repository>

src/main/java/com/github/codedoctorde/linwood/commands/settings/general/RemovePrefixCommand.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.hibernate.Session;
77
import org.jetbrains.annotations.NotNull;
88

9+
import java.text.MessageFormat;
910
import java.util.Arrays;
1011
import java.util.HashSet;
1112
import java.util.ResourceBundle;
@@ -22,7 +23,8 @@ public boolean onCommand(Session session, Message message, GuildEntity entity, S
2223
message.getChannel().sendMessage(bundle.getString("Invalid")).queue();
2324
return true;
2425
}
25-
message.getChannel().sendMessage(bundle.getString("Success")).queue();
26+
entity.save(session);
27+
message.getChannel().sendMessage(MessageFormat.format(bundle.getString("Success"), args[0])).queue();
2628
return true;
2729
}
2830

src/main/java/com/github/codedoctorde/linwood/listener/CommandListener.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import net.dv8tion.jda.api.entities.ChannelType;
77
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
88
import net.dv8tion.jda.api.hooks.SubscribeEvent;
9+
import org.apache.tools.ant.types.Commandline;
910

1011
import javax.annotation.Nonnull;
1112
import java.text.MessageFormat;
@@ -38,7 +39,7 @@ else if (content.startsWith(nicknameMention))
3839
else if (content.startsWith(normalMention))
3940
split = normalMention;
4041
if (split != null) {
41-
var command = content.substring(split.length()).trim().split(" ");
42+
var command = Commandline.translateCommandline(content.substring(split.length()));
4243
var bundle = getBundle(guild);
4344
var commandBundle = Linwood.getInstance().getBaseCommand().getBundle(guild);
4445
try {

0 commit comments

Comments
 (0)