forked from Iroom-gbs/BUKGWAKBOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manager.js
33 lines (32 loc) · 1.04 KB
/
manager.js
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
32
33
var roomList = [];
var scriptList = ["Kaling","DiTalks","gamemodule", "module", "main"]
function response(room, msg, sender, isGroupChat, replier, imageDB, packageName) {
if(isGroupChat&&roomList.indexOf(room)==-1) {
Log.d(room)
roomList.push(room);
}
if(sender==""&&room=="") {
if(msg.startsWith("!공지")) {
for(let i=0;i<roomList.length;i++) {
try {
replier.reply(roomList[i], "📢 공지사항\n============\n" + msg.substr(3));
} catch(e) {
replier.reply(roomList[i]+" 에 메세지를 보낼 수 없습니다.");
}
java.lang.Thread.sleep(5000);
}
}
if(msg=="!방목록") {
replier.reply(roomList.length + "개 방\n---------\n" + roomList.join("\n"));
}
if(msg=="!리로드") {
for(let i=0;i<scriptList.length;i++) {
Api.reload(scriptList[i]);
if(i==0) java.lang.Thread.sleep(1000*3);
Api.on(scriptList[i]);
replier.reply(scriptList[i] + "리로드 완료");
java.lang.Thread.sleep(300);
}
}
}
}