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