-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.js
37 lines (32 loc) · 1.1 KB
/
example.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
// Code by @Arm4x
var Chat = require('./lolchat.io')
// Connection
Chat.connect('user', 'password', 'eu_west');
// Connect event
Chat.events.on('connected', function(data) {
console.log('[i] Connected!');
})
// Update friends
Chat.events.on('onlineUpdate', function(name) {
console.log('[i] update: ' + name);
});
// Send a message to ImNotBadJustABit every 5 seconds
// Function isn't case sensitive
setInterval(function() {
// jid is used for xmpp communication
x=Chat.getFriendJid('Imnotbadjustabit');
console.log(x);
Chat.sendMsg(x,'Hi I am a node.js bot')
// Change status example
Chat.editStatus("<body>\
<profileIcon>973</profileIcon>\
<level>30</level>\
<statusMsg>CHANGED</statusMsg>\
<rankedWins>1337</rankedWins>\
<gameStatus>outOfGame</gameStatus>\
<rankedLeagueName>Twitch's Commanders</rankedLeagueName>\
<rankedLeagueDivision>Zero</rankedLeagueDivision>\
<rankedLeagueTier>DIAMOND</rankedLeagueTier>\
</body>\
");
}, 5000);