mirror of
				https://github.com/LamGC/ContentGrabbingJi.git
				synced 2025-11-03 18:16:56 +00:00 
			
		
		
		
	[Change] ConsoleMain, ConsoleMessageEvent 支持启动时设置会话群组Id和QQId;
This commit is contained in:
		@ -12,6 +12,10 @@ public class ConsoleMain {
 | 
			
		||||
        MessageSenderBuilder.setCurrentMessageSenderFactory(new ConsoleMessageSenderFactory());
 | 
			
		||||
        ApplicationBoot.initialBot();
 | 
			
		||||
        Scanner scanner = new Scanner(System.in);
 | 
			
		||||
        System.out.print("会话QQ:");
 | 
			
		||||
        long qqId = scanner.nextLong();
 | 
			
		||||
        System.out.print("会话群组号:");
 | 
			
		||||
        long groupId = scanner.nextLong();
 | 
			
		||||
        boolean isGroup = false;
 | 
			
		||||
        do {
 | 
			
		||||
            String input = scanner.nextLine();
 | 
			
		||||
@ -23,7 +27,7 @@ public class ConsoleMain {
 | 
			
		||||
                System.out.println("System: 群模式状态已变更: " + isGroup);
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
            BotEventHandler.executeMessageEvent(new ConsoleMessageEvent(input, isGroup));
 | 
			
		||||
            BotEventHandler.executeMessageEvent(new ConsoleMessageEvent(isGroup ? groupId : 0, qqId, input));
 | 
			
		||||
        } while(true);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -6,8 +6,8 @@ import java.util.Date;
 | 
			
		||||
 | 
			
		||||
public class ConsoleMessageEvent extends MessageEvent {
 | 
			
		||||
 | 
			
		||||
    public ConsoleMessageEvent(String message, boolean isGroup) {
 | 
			
		||||
        super(isGroup ? 1 : 0, 1, message);
 | 
			
		||||
    public ConsoleMessageEvent(long groupId, long qqId, String message) {
 | 
			
		||||
        super(groupId, qqId, message);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user