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