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

fix prefix command, change command handle #15

Merged
merged 1 commit into from
Aug 11, 2020
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
![Build Status](https://ci.codemc.io/job/CodeDoctorDE/job/Linwood/badge/icon)
# Linwood
Java bot with many features. Developed by @CodeDoctorDE (Discord: CodeDoctor#8719)

Expand Down
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.codedoctorde</groupId>
<artifactId>linwood</artifactId>
<version>1.0</version>
<version>1.0.1</version>
<properties>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -174,6 +174,12 @@
<artifactId>icu4j</artifactId>
<version>67.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.ant/ant -->
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.10.8</version>
</dependency>
</dependencies>
<distributionManagement>
<repository>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.hibernate.Session;
import org.jetbrains.annotations.NotNull;

import java.text.MessageFormat;
import java.util.Arrays;
import java.util.HashSet;
import java.util.ResourceBundle;
Expand All @@ -22,7 +23,8 @@ public boolean onCommand(Session session, Message message, GuildEntity entity, S
message.getChannel().sendMessage(bundle.getString("Invalid")).queue();
return true;
}
message.getChannel().sendMessage(bundle.getString("Success")).queue();
entity.save(session);
message.getChannel().sendMessage(MessageFormat.format(bundle.getString("Success"), args[0])).queue();
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.dv8tion.jda.api.entities.ChannelType;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.hooks.SubscribeEvent;
import org.apache.tools.ant.types.Commandline;

import javax.annotation.Nonnull;
import java.text.MessageFormat;
Expand Down Expand Up @@ -38,7 +39,7 @@ else if (content.startsWith(nicknameMention))
else if (content.startsWith(normalMention))
split = normalMention;
if (split != null) {
var command = content.substring(split.length()).trim().split(" ");
var command = Commandline.translateCommandline(content.substring(split.length()));
var bundle = getBundle(guild);
var commandBundle = Linwood.getInstance().getBaseCommand().getBundle(guild);
try {
Expand Down