[~] 修改消息转发逻辑
This commit is contained in:
parent
3c386797d3
commit
ad598de368
@ -56,7 +56,10 @@ public class Chatting {
|
|||||||
|
|
||||||
if(isPrefixed(message)) {
|
if(isPrefixed(message)) {
|
||||||
|
|
||||||
|
if(shouldSubstring(message)) {
|
||||||
message = removePrefix(message);
|
message = removePrefix(message);
|
||||||
|
}
|
||||||
|
|
||||||
message = CQUtils.removeCqCode(message);
|
message = CQUtils.removeCqCode(message);
|
||||||
|
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
@ -97,7 +100,9 @@ public class Chatting {
|
|||||||
|
|
||||||
if(isPrefixed(message)) {
|
if(isPrefixed(message)) {
|
||||||
|
|
||||||
|
if(shouldSubstring(message)) {
|
||||||
message = removePrefix(message);
|
message = removePrefix(message);
|
||||||
|
}
|
||||||
|
|
||||||
evt.setMessage(message);
|
evt.setMessage(message);
|
||||||
|
|
||||||
@ -120,6 +125,11 @@ public class Chatting {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean shouldSubstring(String message) {
|
||||||
|
if(!Config.require_prefix) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public static String removePrefix(String message) {
|
public static String removePrefix(String message) {
|
||||||
return message.length() < 1 ? "" : message.substring(1);
|
return message.length() < 1 ? "" : message.substring(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user