Add 'server/mmoirc.js'
This commit is contained in:
parent
7878b0bbc9
commit
9bab4768d0
|
@ -0,0 +1,22 @@
|
|||
const tmi = require('tmi.js');
|
||||
|
||||
const client = new tmi.Client({
|
||||
options: { debug: true },
|
||||
identity: {
|
||||
username: 'my_bot_name',
|
||||
password: 'oauth:my_bot_token'
|
||||
},
|
||||
channels: [ 'my_name' ]
|
||||
});
|
||||
|
||||
client.connect();
|
||||
|
||||
client.on('message', (channel, tags, message, self) => {
|
||||
// Ignore echoed messages.
|
||||
if(self) return;
|
||||
|
||||
if(message.toLowerCase() === '!hello') {
|
||||
// "@alca, heya!"
|
||||
client.say(channel, `@${tags.username}, heya!`);
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue