-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
60 lines (51 loc) · 1.45 KB
/
app.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const tmi = require("tmi.js");
const request = require('request');
let lang = "kr_ko";//kr_ko, en_us
const local = require(`./local/${lang}.json`);
let cmd = local.cmd.chat
let prefix = local.bot.setting.prefix
const options = {
options: {
debug: true
},
connection: {
reconnect: true,
},
identity: {
username: local.bot.setting.username,
password: local.bot.setting.password
},
channels: ["#"+ local.channel]
};
let client = new tmi.client(options);
// Connect the client to the server..
client.connect();
client.on("chat", (channel, user, message, self) => {
// if (self) return;
let sender = user['display-name'];
if (message === prefix + cmd.산군) {
for(i=0; i <15; i++){
client.action(local.channel, local.chat.sangoon)
}
}
if (message === prefix + cmd.clear) {
if(user['mod'] === true){
client.clear(local.channel);
}else{
client.action(local.channel, local.chat.notclear)
}
}
if (message === prefix + cmd.uptime) {
request("https://decapi.me/twitch/uptime/" + local.channel, function (err, response, body) {
if (err) {
console.log(err)
}
client.action(local.channel, body)
});
}
});
/*
* client.on("join", (channel, username, self) => {
* client.action(local.channel, username + " ㅎㅇ")
* });
*/