-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.js
24 lines (22 loc) · 851 Bytes
/
bot.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const tmi = require('tmi.js');
require('dotenv').config();
const client = new tmi.Client({
options: { debug: false },
identity: {
username: process.env.username,
password: process.env.password
},
channels: [ process.env.channel ]
});
client.connect();
client.on('message', (channel, tags, message) => {
if (tags.username === 'streamelements' && message.includes("a Multi-Raffle has begun for"/* + process.env.username.toLowerCase()*/)) {
console.log('********* RAFFLE STARTED *********', process.env.username);
time.sleep(1)
client.say(channel, "!join"); // for now
};
if (tags.username === 'streamelements' && message.includes("The Multi-Raffle has ended and") && message.includes(process.env.username.toLowerCase())) {
console.log('********* WON *********', process.env.username);
client.say(channel, "ez");
};
});