Commit 8f013aa 1 parent 47aab3b commit 8f013aa Copy full SHA for 8f013aa
File tree 8 files changed +60
-8
lines changed
src/main/java/me/dreamvoid/miraimc/bukkit
src/main/java/me/dreamvoid/miraimc/bungee/commands
src/main/java/me/dreamvoid/miraimc/nukkit
src/main/java/me/dreamvoid/miraimc/sponge/commands
8 files changed +60
-8
lines changed Original file line number Diff line number Diff line change 48
48
<artifactId >maven-shade-plugin</artifactId >
49
49
<version >3.2.4</version >
50
50
<configuration >
51
+ <minimizeJar >true</minimizeJar >
51
52
<relocations >
52
53
<relocation >
53
54
<pattern >com.zaxxer</pattern >
Original file line number Diff line number Diff line change @@ -91,7 +91,13 @@ public void run() {
91
91
case "sendgroupmessage" :{
92
92
if (sender .hasPermission ("miraimc.command.mirai.sendgroupmessage" )){
93
93
if (args .length >= 4 ){
94
- MiraiBot .getBot (Long .parseLong (args [1 ])).getGroup (Long .parseLong (args [2 ])).sendMessage (args [3 ]);
94
+ StringBuilder message = new StringBuilder ();
95
+ for (int i = 0 ; i < args .length ; i ++) { //list.size()就是循环的次数
96
+ if (i >= 3 ){
97
+ message .append (args [i ]).append (" " );
98
+ }
99
+ }
100
+ MiraiBot .getBot (Long .parseLong (args [1 ])).getGroup (Long .parseLong (args [2 ])).sendMessage (message .toString ().replace ("\\ n" ,System .lineSeparator ()));
95
101
} else {
96
102
sender .sendMessage (ChatColor .translateAlternateColorCodes ('&' ,"&c无效的参数!用法: /mirai sendgroupmessage <账号> <群号> <消息>" ));
97
103
}
@@ -101,7 +107,13 @@ public void run() {
101
107
case "sendfriendmessage" :{
102
108
if (sender .hasPermission ("miraimc.command.mirai.sendfriendmessage" )){
103
109
if (args .length >= 4 ){
104
- MiraiBot .getBot (Long .parseLong (args [1 ])).getFriend (Long .parseLong (args [2 ])).sendMessage (args [3 ]);
110
+ StringBuilder message = new StringBuilder ();
111
+ for (int i = 0 ; i < args .length ; i ++) { //list.size()就是循环的次数
112
+ if (i >= 3 ){
113
+ message .append (args [i ]).append (" " );
114
+ }
115
+ }
116
+ MiraiBot .getBot (Long .parseLong (args [1 ])).getFriend (Long .parseLong (args [2 ])).sendMessage (message .toString ().replace ("\\ n" ,System .lineSeparator ()));
105
117
} else {
106
118
sender .sendMessage (ChatColor .translateAlternateColorCodes ('&' ,"&c无效的参数!用法: /mirai sendfriendmessage <账号> <好友> <消息>" ));
107
119
}
Original file line number Diff line number Diff line change 66
66
<artifactId >maven-shade-plugin</artifactId >
67
67
<version >3.2.4</version >
68
68
<configuration >
69
+ <minimizeJar >true</minimizeJar >
69
70
<relocations >
70
71
<relocation >
71
72
<pattern >com.zaxxer</pattern >
Original file line number Diff line number Diff line change @@ -83,7 +83,13 @@ public void execute(CommandSender sender, String[] args) {
83
83
case "sendgroupmessage" :{
84
84
if (sender .hasPermission ("miraimc.command.mirai.sendgroupmessage" )){
85
85
if (args .length >= 4 ){
86
- MiraiBot .getBot (Long .parseLong (args [1 ])).getGroup (Long .parseLong (args [2 ])).sendMessage (args [3 ]);
86
+ StringBuilder message = new StringBuilder ();
87
+ for (int i = 0 ; i < args .length ; i ++) { //list.size()就是循环的次数
88
+ if (i >= 3 ){
89
+ message .append (args [i ]).append (" " );
90
+ }
91
+ }
92
+ MiraiBot .getBot (Long .parseLong (args [1 ])).getGroup (Long .parseLong (args [2 ])).sendMessage (message .toString ().replace ("\\ n" ,System .lineSeparator ()));
87
93
} else {
88
94
sender .sendMessage (new TextComponent (ChatColor .translateAlternateColorCodes ('&' ,"&c无效的参数!用法: /mirai sendgroupmessage <账号> <群号> <消息>" )));
89
95
}
@@ -93,7 +99,13 @@ public void execute(CommandSender sender, String[] args) {
93
99
case "sendfriendmessage" :{
94
100
if (sender .hasPermission ("miraimc.command.mirai.sendfriendmessage" )){
95
101
if (args .length >= 4 ){
96
- MiraiBot .getBot (Long .parseLong (args [1 ])).getFriend (Long .parseLong (args [2 ])).sendMessage (args [3 ]);
102
+ StringBuilder message = new StringBuilder ();
103
+ for (int i = 0 ; i < args .length ; i ++) { //list.size()就是循环的次数
104
+ if (i >= 3 ){
105
+ message .append (args [i ]).append (" " );
106
+ }
107
+ }
108
+ MiraiBot .getBot (Long .parseLong (args [1 ])).getFriend (Long .parseLong (args [2 ])).sendMessage (message .toString ().replace ("\\ n" ,System .lineSeparator ()));
97
109
} else {
98
110
sender .sendMessage (new TextComponent (ChatColor .translateAlternateColorCodes ('&' ,"&c无效的参数!用法: /mirai sendfriendmessage <账号> <好友> <消息>" )));
99
111
}
Original file line number Diff line number Diff line change 73
73
<artifactId >maven-shade-plugin</artifactId >
74
74
<version >3.2.4</version >
75
75
<configuration >
76
+ <minimizeJar >true</minimizeJar >
76
77
<relocations >
77
78
<relocation >
78
79
<pattern >com.zaxxer</pattern >
Original file line number Diff line number Diff line change @@ -88,7 +88,13 @@ public void onRun() {
88
88
case "sendgroupmessage" :{
89
89
if (sender .hasPermission ("miraimc.command.mirai.sendgroupmessage" )){
90
90
if (args .length >= 4 ){
91
- MiraiBot .getBot (Long .parseLong (args [1 ])).getGroup (Long .parseLong (args [2 ])).sendMessage (args [3 ]);
91
+ StringBuilder message = new StringBuilder ();
92
+ for (int i = 0 ; i < args .length ; i ++) { //list.size()就是循环的次数
93
+ if (i >= 3 ){
94
+ message .append (args [i ]).append (" " );
95
+ }
96
+ }
97
+ MiraiBot .getBot (Long .parseLong (args [1 ])).getGroup (Long .parseLong (args [2 ])).sendMessage (message .toString ().replace ("\\ n" , System .lineSeparator ()));
92
98
} else {
93
99
sender .sendMessage (TextFormat .colorize ('&' ,"&c无效的参数!用法: /mirai sendgroupmessage <账号> <群号> <消息>" ));
94
100
}
@@ -98,7 +104,13 @@ public void onRun() {
98
104
case "sendfriendmessage" :{
99
105
if (sender .hasPermission ("miraimc.command.mirai.sendfriendmessage" )){
100
106
if (args .length >= 4 ){
101
- MiraiBot .getBot (Long .parseLong (args [1 ])).getFriend (Long .parseLong (args [2 ])).sendMessage (args [3 ]);
107
+ StringBuilder message = new StringBuilder ();
108
+ for (int i = 0 ; i < args .length ; i ++) { //list.size()就是循环的次数
109
+ if (i >= 3 ){
110
+ message .append (args [i ]).append (" " );
111
+ }
112
+ }
113
+ MiraiBot .getBot (Long .parseLong (args [1 ])).getFriend (Long .parseLong (args [2 ])).sendMessage (message .toString ().replace ("\\ n" , System .lineSeparator ()));
102
114
} else {
103
115
sender .sendMessage (TextFormat .colorize ('&' ,"&c无效的参数!用法: /mirai sendfriendmessage <账号> <好友> <消息>" ));
104
116
}
Original file line number Diff line number Diff line change 54
54
<artifactId >maven-shade-plugin</artifactId >
55
55
<version >3.2.4</version >
56
56
<configuration >
57
+ <minimizeJar >true</minimizeJar >
57
58
<relocations >
58
59
<relocation >
59
60
<pattern >org.apache.commons.codec</pattern >
Original file line number Diff line number Diff line change @@ -84,7 +84,13 @@ public MiraiCommand(SpongePlugin plugin){
84
84
case "sendgroupmessage" :{
85
85
if (src .hasPermission ("miraimc.command.mirai.sendgroupmessage" )){
86
86
if (args .length >= 4 ){
87
- MiraiBot .getBot (Long .parseLong (args [1 ])).getGroup (Long .parseLong (args [2 ])).sendMessage (args [3 ]);
87
+ StringBuilder message = new StringBuilder ();
88
+ for (int i = 0 ; i < args .length ; i ++) { //list.size()就是循环的次数
89
+ if (i >= 3 ){
90
+ message .append (args [i ]).append (" " );
91
+ }
92
+ }
93
+ MiraiBot .getBot (Long .parseLong (args [1 ])).getGroup (Long .parseLong (args [2 ])).sendMessage (message .toString ().replace ("\\ n" , System .lineSeparator ()));
88
94
} else {
89
95
src .sendMessage (TextSerializers .FORMATTING_CODE .deserialize ("&c无效的参数!用法: /mirai sendgroupmessage <账号> <群号> <消息>" ));
90
96
}
@@ -94,7 +100,13 @@ public MiraiCommand(SpongePlugin plugin){
94
100
case "sendfriendmessage" :{
95
101
if (src .hasPermission ("miraimc.command.mirai.sendfriendmessage" )){
96
102
if (args .length >= 4 ){
97
- MiraiBot .getBot (Long .parseLong (args [1 ])).getFriend (Long .parseLong (args [2 ])).sendMessage (args [3 ]);
103
+ StringBuilder message = new StringBuilder ();
104
+ for (int i = 0 ; i < args .length ; i ++) { //list.size()就是循环的次数
105
+ if (i >= 3 ){
106
+ message .append (args [i ]).append (" " );
107
+ }
108
+ }
109
+ MiraiBot .getBot (Long .parseLong (args [1 ])).getFriend (Long .parseLong (args [2 ])).sendMessage (message .toString ().replace ("\\ n" , System .lineSeparator ()));
98
110
} else {
99
111
src .sendMessage (TextSerializers .FORMATTING_CODE .deserialize ("&c无效的参数!用法: /mirai sendfriendmessage <账号> <好友> <消息>" ));
100
112
}
You can’t perform that action at this time.
0 commit comments