-
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathtest_channel_create_delete.java
More file actions
29 lines (27 loc) · 931 Bytes
/
test_channel_create_delete.java
File metadata and controls
29 lines (27 loc) · 931 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
import io.github.kloping.qqbot.Starter;
import io.github.kloping.qqbot.entities.Bot;
import io.github.kloping.qqbot.entities.ex.ChannelData;
import io.github.kloping.qqbot.entities.qqpd.Channel;
import io.github.kloping.qqbot.entities.qqpd.Guild;
/**
* @author github.kloping
*/
public class test_channel_create_delete {
public static void main(String[] args) {
Starter starter = test_main.factory();
starter.run();
Bot bot = starter.getBot();
for (Guild guild : bot.guilds()) {
for (Channel channel : guild.channels()) {
if (channel.getName().equals("xxx")) {
//频道删除
channel.delete();
}
}
//频道创建 创建详细信息 见 ChannelData 文档
guild.create(new ChannelData()
.name("测试创建子频道")
);
}
}
}