-
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathtest_inputSendMessage.java
More file actions
31 lines (29 loc) · 1002 Bytes
/
test_inputSendMessage.java
File metadata and controls
31 lines (29 loc) · 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import io.github.kloping.qqbot.Starter;
import io.github.kloping.qqbot.entities.qqpd.Channel;
import io.github.kloping.qqbot.entities.qqpd.Guild;
import java.util.Scanner;
/**
* @author github.kloping
*/
public class test_inputSendMessage {
public static void main(String[] args) throws Exception {
Starter starter = test_main.factory();
starter.run();
Guild[] guilds = starter.getBot().guilds().toArray(new Guild[0]);
Channel[] channels = starter.getBot().guildBase.getChannels(guilds[0].getId());
Channel channel = null;
for (Channel channel1 : channels) {
if (channel1.getName().equals("游戏大厅")) {
channel = channel1;
}
}
Thread.sleep(5000);
String line = null;
Scanner sc = new Scanner(System.in);
while (true) {
line = sc.nextLine();
if (line == null || line.isEmpty()) continue;
channel.send(line);
}
}
}