Skip to content

Commit

Permalink
fixed minor problems
Browse files Browse the repository at this point in the history
  • Loading branch information
khjxiaogu committed Aug 21, 2020
1 parent 0a4d93b commit d6f305b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.khjxiaogu</groupId>
<artifactId>MiraiSongPlugin</artifactId>
<version>0.0.4-STABLE</version>
<version>0.0.5-STABLE</version>
<name>MiraiSongPlugin</name>
<description>使用“#音乐 关键词”、“#Q音 关键词”、“#网易 关键词”进行点歌,</description>
<build>
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/com/khjxiaogu/MusicToVoice/MusicToVoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,15 @@ public void songToVoice(String musicURL, Consumer<? super InputStream> csm) {
public void onEnable() {
this.getEventListener().subscribeAlways(GroupMessageEvent.class, event -> {
PlainText pt=event.getMessage().first(PlainText.Key);
if(pt==null)
return;
String[] args=pt.getContent().trim().split(" ");
Group eg=event.getGroup();
if (args[0].startsWith("#音乐")) {

String sn = null;
try {
sn = URLEncoder.encode(String.join(",", Arrays.copyOfRange(args, 1, args.length)), "UTF-8");
sn = URLEncoder.encode(String.join(" ", Arrays.copyOfRange(args, 1, args.length)), "UTF-8");
} catch (UnsupportedEncodingException ignored) {
}
String songname = sn;
Expand All @@ -276,7 +278,7 @@ public void onEnable() {
}else if (args[0].startsWith("#Q音")) {
String sn = null;
try {
sn = URLEncoder.encode(String.join(",", Arrays.copyOfRange(args, 1, args.length)), "UTF-8");
sn = URLEncoder.encode(String.join(" ", Arrays.copyOfRange(args, 1, args.length)), "UTF-8");
} catch (UnsupportedEncodingException ignored) {
}
String songname = sn;
Expand All @@ -288,7 +290,7 @@ public void onEnable() {
}else if (args[0].startsWith("#网易")) {
String sn = null;
try {
sn = URLEncoder.encode(String.join(",", Arrays.copyOfRange(args, 1, args.length)), "UTF-8");
sn = URLEncoder.encode(String.join(" ", Arrays.copyOfRange(args, 1, args.length)), "UTF-8");
} catch (UnsupportedEncodingException ignored) {
}
String songname = sn;
Expand Down

0 comments on commit d6f305b

Please sign in to comment.