@@ -5,7 +5,7 @@ function followersonly(channel, minutes) {
5
5
channel = _ . channel ( channel ) ;
6
6
minutes = _ . get ( minutes , 30 ) ;
7
7
// Send the command to the server and race the Promise against a delay..
8
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , `/followers ${ minutes } ` , ( resolve , reject ) => {
8
+ return this . _sendCommand ( null , channel , `/followers ${ minutes } ` , ( resolve , reject ) => {
9
9
// Received _promiseFollowers event, resolve or reject..
10
10
this . once ( '_promiseFollowers' , err => {
11
11
if ( ! err ) { resolve ( [ channel , ~ ~ minutes ] ) ; }
@@ -18,7 +18,7 @@ function followersonly(channel, minutes) {
18
18
function followersonlyoff ( channel ) {
19
19
channel = _ . channel ( channel ) ;
20
20
// Send the command to the server and race the Promise against a delay..
21
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , '/followersoff' , ( resolve , reject ) => {
21
+ return this . _sendCommand ( null , channel , '/followersoff' , ( resolve , reject ) => {
22
22
// Received _promiseFollowersoff event, resolve or reject..
23
23
this . once ( '_promiseFollowersoff' , err => {
24
24
if ( ! err ) { resolve ( [ channel ] ) ; }
@@ -31,7 +31,7 @@ function followersonlyoff(channel) {
31
31
function part ( channel ) {
32
32
channel = _ . channel ( channel ) ;
33
33
// Send the command to the server and race the Promise against a delay..
34
- return this . _sendCommand ( this . _getPromiseDelay ( ) , null , `PART ${ channel } ` , ( resolve , reject ) => {
34
+ return this . _sendCommand ( null , null , `PART ${ channel } ` , ( resolve , reject ) => {
35
35
// Received _promisePart event, resolve or reject..
36
36
this . once ( '_promisePart' , err => {
37
37
if ( ! err ) { resolve ( [ channel ] ) ; }
@@ -44,7 +44,7 @@ function part(channel) {
44
44
function r9kbeta ( channel ) {
45
45
channel = _ . channel ( channel ) ;
46
46
// Send the command to the server and race the Promise against a delay..
47
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , '/r9kbeta' , ( resolve , reject ) => {
47
+ return this . _sendCommand ( null , channel , '/r9kbeta' , ( resolve , reject ) => {
48
48
// Received _promiseR9kbeta event, resolve or reject..
49
49
this . once ( '_promiseR9kbeta' , err => {
50
50
if ( ! err ) { resolve ( [ channel ] ) ; }
@@ -57,7 +57,7 @@ function r9kbeta(channel) {
57
57
function r9kbetaoff ( channel ) {
58
58
channel = _ . channel ( channel ) ;
59
59
// Send the command to the server and race the Promise against a delay..
60
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , '/r9kbetaoff' , ( resolve , reject ) => {
60
+ return this . _sendCommand ( null , channel , '/r9kbetaoff' , ( resolve , reject ) => {
61
61
// Received _promiseR9kbetaoff event, resolve or reject..
62
62
this . once ( '_promiseR9kbetaoff' , err => {
63
63
if ( ! err ) { resolve ( [ channel ] ) ; }
@@ -71,7 +71,7 @@ function slow(channel, seconds) {
71
71
channel = _ . channel ( channel ) ;
72
72
seconds = _ . get ( seconds , 300 ) ;
73
73
// Send the command to the server and race the Promise against a delay..
74
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , `/slow ${ seconds } ` , ( resolve , reject ) => {
74
+ return this . _sendCommand ( null , channel , `/slow ${ seconds } ` , ( resolve , reject ) => {
75
75
// Received _promiseSlow event, resolve or reject..
76
76
this . once ( '_promiseSlow' , err => {
77
77
if ( ! err ) { resolve ( [ channel , ~ ~ seconds ] ) ; }
@@ -84,7 +84,7 @@ function slow(channel, seconds) {
84
84
function slowoff ( channel ) {
85
85
channel = _ . channel ( channel ) ;
86
86
// Send the command to the server and race the Promise against a delay..
87
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , '/slowoff' , ( resolve , reject ) => {
87
+ return this . _sendCommand ( null , channel , '/slowoff' , ( resolve , reject ) => {
88
88
// Received _promiseSlowoff event, resolve or reject..
89
89
this . once ( '_promiseSlowoff' , err => {
90
90
if ( ! err ) { resolve ( [ channel ] ) ; }
@@ -112,7 +112,7 @@ module.exports = {
112
112
username = _ . username ( username ) ;
113
113
reason = _ . get ( reason , '' ) ;
114
114
// Send the command to the server and race the Promise against a delay..
115
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , `/ban ${ username } ${ reason } ` , ( resolve , reject ) => {
115
+ return this . _sendCommand ( null , channel , `/ban ${ username } ${ reason } ` , ( resolve , reject ) => {
116
116
// Received _promiseBan event, resolve or reject..
117
117
this . once ( '_promiseBan' , err => {
118
118
if ( ! err ) { resolve ( [ channel , username , reason ] ) ; }
@@ -125,7 +125,7 @@ module.exports = {
125
125
clear ( channel ) {
126
126
channel = _ . channel ( channel ) ;
127
127
// Send the command to the server and race the Promise against a delay..
128
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , '/clear' , ( resolve , reject ) => {
128
+ return this . _sendCommand ( null , channel , '/clear' , ( resolve , reject ) => {
129
129
// Received _promiseClear event, resolve or reject..
130
130
this . once ( '_promiseClear' , err => {
131
131
if ( ! err ) { resolve ( [ channel ] ) ; }
@@ -138,7 +138,7 @@ module.exports = {
138
138
color ( channel , newColor ) {
139
139
newColor = _ . get ( newColor , channel ) ;
140
140
// Send the command to the server and race the Promise against a delay..
141
- return this . _sendCommand ( this . _getPromiseDelay ( ) , '#tmijs' , `/color ${ newColor } ` , ( resolve , reject ) => {
141
+ return this . _sendCommand ( null , '#tmijs' , `/color ${ newColor } ` , ( resolve , reject ) => {
142
142
// Received _promiseColor event, resolve or reject..
143
143
this . once ( '_promiseColor' , err => {
144
144
if ( ! err ) { resolve ( [ newColor ] ) ; }
@@ -152,7 +152,7 @@ module.exports = {
152
152
channel = _ . channel ( channel ) ;
153
153
seconds = _ . get ( seconds , 30 ) ;
154
154
// Send the command to the server and race the Promise against a delay..
155
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , `/commercial ${ seconds } ` , ( resolve , reject ) => {
155
+ return this . _sendCommand ( null , channel , `/commercial ${ seconds } ` , ( resolve , reject ) => {
156
156
// Received _promiseCommercial event, resolve or reject..
157
157
this . once ( '_promiseCommercial' , err => {
158
158
if ( ! err ) { resolve ( [ channel , ~ ~ seconds ] ) ; }
@@ -165,7 +165,7 @@ module.exports = {
165
165
deletemessage ( channel , messageUUID ) {
166
166
channel = _ . channel ( channel ) ;
167
167
// Send the command to the server and race the Promise against a delay..
168
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , `/delete ${ messageUUID } ` , ( resolve , reject ) => {
168
+ return this . _sendCommand ( null , channel , `/delete ${ messageUUID } ` , ( resolve , reject ) => {
169
169
// Received _promiseDeletemessage event, resolve or reject..
170
170
this . once ( '_promiseDeletemessage' , err => {
171
171
if ( ! err ) { resolve ( [ channel ] ) ; }
@@ -178,7 +178,7 @@ module.exports = {
178
178
emoteonly ( channel ) {
179
179
channel = _ . channel ( channel ) ;
180
180
// Send the command to the server and race the Promise against a delay..
181
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , '/emoteonly' , ( resolve , reject ) => {
181
+ return this . _sendCommand ( null , channel , '/emoteonly' , ( resolve , reject ) => {
182
182
// Received _promiseEmoteonly event, resolve or reject..
183
183
this . once ( '_promiseEmoteonly' , err => {
184
184
if ( ! err ) { resolve ( [ channel ] ) ; }
@@ -191,7 +191,7 @@ module.exports = {
191
191
emoteonlyoff ( channel ) {
192
192
channel = _ . channel ( channel ) ;
193
193
// Send the command to the server and race the Promise against a delay..
194
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , '/emoteonlyoff' , ( resolve , reject ) => {
194
+ return this . _sendCommand ( null , channel , '/emoteonlyoff' , ( resolve , reject ) => {
195
195
// Received _promiseEmoteonlyoff event, resolve or reject..
196
196
this . once ( '_promiseEmoteonlyoff' , err => {
197
197
if ( ! err ) { resolve ( [ channel ] ) ; }
@@ -201,13 +201,13 @@ module.exports = {
201
201
} ,
202
202
203
203
// Enable followers-only mode on a channel..
204
- followersonly : followersonly ,
204
+ followersonly,
205
205
206
206
// Alias for followersonly()..
207
207
followersmode : followersonly ,
208
208
209
209
// Disable followers-only mode on a channel..
210
- followersonlyoff : followersonlyoff ,
210
+ followersonlyoff,
211
211
212
212
// Alias for followersonlyoff()..
213
213
followersmodeoff : followersonlyoff ,
@@ -230,7 +230,7 @@ module.exports = {
230
230
join ( channel ) {
231
231
channel = _ . channel ( channel ) ;
232
232
// Send the command to the server ..
233
- return this . _sendCommand ( null , null , `JOIN ${ channel } ` , ( resolve , reject ) => {
233
+ return this . _sendCommand ( undefined , null , `JOIN ${ channel } ` , ( resolve , reject ) => {
234
234
const eventName = '_promiseJoin' ;
235
235
let hasFulfilled = false ;
236
236
const listener = ( err , joinedChannel ) => {
@@ -258,7 +258,7 @@ module.exports = {
258
258
channel = _ . channel ( channel ) ;
259
259
username = _ . username ( username ) ;
260
260
// Send the command to the server and race the Promise against a delay..
261
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , `/mod ${ username } ` , ( resolve , reject ) => {
261
+ return this . _sendCommand ( null , channel , `/mod ${ username } ` , ( resolve , reject ) => {
262
262
// Received _promiseMod event, resolve or reject..
263
263
this . once ( '_promiseMod' , err => {
264
264
if ( ! err ) { resolve ( [ channel , username ] ) ; }
@@ -271,7 +271,7 @@ module.exports = {
271
271
mods ( channel ) {
272
272
channel = _ . channel ( channel ) ;
273
273
// Send the command to the server and race the Promise against a delay..
274
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , '/mods' , ( resolve , reject ) => {
274
+ return this . _sendCommand ( null , channel , '/mods' , ( resolve , reject ) => {
275
275
// Received _promiseMods event, resolve or reject..
276
276
this . once ( '_promiseMods' , ( err , mods ) => {
277
277
if ( ! err ) {
@@ -288,15 +288,15 @@ module.exports = {
288
288
} ,
289
289
290
290
// Leave a channel..
291
- part : part ,
291
+ part,
292
292
293
293
// Alias for part()..
294
294
leave : part ,
295
295
296
296
// Send a ping to the server..
297
297
ping ( ) {
298
298
// Send the command to the server and race the Promise against a delay..
299
- return this . _sendCommand ( this . _getPromiseDelay ( ) , null , 'PING' , ( resolve , _reject ) => {
299
+ return this . _sendCommand ( null , null , 'PING' , ( resolve , _reject ) => {
300
300
// Update the internal ping timeout check interval..
301
301
this . latency = new Date ( ) ;
302
302
this . pingTimeout = setTimeout ( ( ) => {
@@ -316,21 +316,21 @@ module.exports = {
316
316
} ,
317
317
318
318
// Enable R9KBeta mode on a channel..
319
- r9kbeta : r9kbeta ,
319
+ r9kbeta,
320
320
321
321
// Alias for r9kbeta()..
322
322
r9kmode : r9kbeta ,
323
323
324
324
// Disable R9KBeta mode on a channel..
325
- r9kbetaoff : r9kbetaoff ,
325
+ r9kbetaoff,
326
326
327
327
// Alias for r9kbetaoff()..
328
328
r9kmodeoff : r9kbetaoff ,
329
329
330
330
// Send a raw message to the server..
331
331
raw ( message ) {
332
332
// Send the command to the server and race the Promise against a delay..
333
- return this . _sendCommand ( this . _getPromiseDelay ( ) , null , message , ( resolve , _reject ) => {
333
+ return this . _sendCommand ( null , null , message , ( resolve , _reject ) => {
334
334
resolve ( [ message ] ) ;
335
335
} ) ;
336
336
} ,
@@ -346,7 +346,7 @@ module.exports = {
346
346
}
347
347
else {
348
348
// Send the command to the server and race the Promise against a delay..
349
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , message , ( resolve , _reject ) => {
349
+ return this . _sendCommand ( null , channel , message , ( resolve , _reject ) => {
350
350
// At this time, there is no possible way to detect if a message has been sent has been eaten
351
351
// by the server, so we can only resolve the Promise.
352
352
resolve ( [ channel , message ] ) ;
@@ -362,13 +362,13 @@ module.exports = {
362
362
} ,
363
363
364
364
// Enable slow mode on a channel..
365
- slow : slow ,
365
+ slow,
366
366
367
367
// Alias for slow()..
368
368
slowmode : slow ,
369
369
370
370
// Disable slow mode on a channel..
371
- slowoff : slowoff ,
371
+ slowoff,
372
372
373
373
// Alias for slowoff()..
374
374
slowmodeoff : slowoff ,
@@ -377,7 +377,7 @@ module.exports = {
377
377
subscribers ( channel ) {
378
378
channel = _ . channel ( channel ) ;
379
379
// Send the command to the server and race the Promise against a delay..
380
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , '/subscribers' , ( resolve , reject ) => {
380
+ return this . _sendCommand ( null , channel , '/subscribers' , ( resolve , reject ) => {
381
381
// Received _promiseSubscribers event, resolve or reject..
382
382
this . once ( '_promiseSubscribers' , err => {
383
383
if ( ! err ) { resolve ( [ channel ] ) ; }
@@ -390,7 +390,7 @@ module.exports = {
390
390
subscribersoff ( channel ) {
391
391
channel = _ . channel ( channel ) ;
392
392
// Send the command to the server and race the Promise against a delay..
393
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , '/subscribersoff' , ( resolve , reject ) => {
393
+ return this . _sendCommand ( null , channel , '/subscribersoff' , ( resolve , reject ) => {
394
394
// Received _promiseSubscribersoff event, resolve or reject..
395
395
this . once ( '_promiseSubscribersoff' , err => {
396
396
if ( ! err ) { resolve ( [ channel ] ) ; }
@@ -412,7 +412,7 @@ module.exports = {
412
412
seconds = _ . get ( seconds , 300 ) ;
413
413
reason = _ . get ( reason , '' ) ;
414
414
// Send the command to the server and race the Promise against a delay..
415
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , `/timeout ${ username } ${ seconds } ${ reason } ` , ( resolve , reject ) => {
415
+ return this . _sendCommand ( null , channel , `/timeout ${ username } ${ seconds } ${ reason } ` , ( resolve , reject ) => {
416
416
// Received _promiseTimeout event, resolve or reject..
417
417
this . once ( '_promiseTimeout' , err => {
418
418
if ( ! err ) { resolve ( [ channel , username , ~ ~ seconds , reason ] ) ; }
@@ -426,7 +426,7 @@ module.exports = {
426
426
channel = _ . channel ( channel ) ;
427
427
username = _ . username ( username ) ;
428
428
// Send the command to the server and race the Promise against a delay..
429
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , `/unban ${ username } ` , ( resolve , reject ) => {
429
+ return this . _sendCommand ( null , channel , `/unban ${ username } ` , ( resolve , reject ) => {
430
430
// Received _promiseUnban event, resolve or reject..
431
431
this . once ( '_promiseUnban' , err => {
432
432
if ( ! err ) { resolve ( [ channel , username ] ) ; }
@@ -453,7 +453,7 @@ module.exports = {
453
453
channel = _ . channel ( channel ) ;
454
454
username = _ . username ( username ) ;
455
455
// Send the command to the server and race the Promise against a delay..
456
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , `/unmod ${ username } ` , ( resolve , reject ) => {
456
+ return this . _sendCommand ( null , channel , `/unmod ${ username } ` , ( resolve , reject ) => {
457
457
// Received _promiseUnmod event, resolve or reject..
458
458
this . once ( '_promiseUnmod' , err => {
459
459
if ( ! err ) { resolve ( [ channel , username ] ) ; }
@@ -467,7 +467,7 @@ module.exports = {
467
467
channel = _ . channel ( channel ) ;
468
468
username = _ . username ( username ) ;
469
469
// Send the command to the server and race the Promise against a delay..
470
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , `/unvip ${ username } ` , ( resolve , reject ) => {
470
+ return this . _sendCommand ( null , channel , `/unvip ${ username } ` , ( resolve , reject ) => {
471
471
// Received _promiseUnvip event, resolve or reject..
472
472
this . once ( '_promiseUnvip' , err => {
473
473
if ( ! err ) { resolve ( [ channel , username ] ) ; }
@@ -481,7 +481,7 @@ module.exports = {
481
481
channel = _ . channel ( channel ) ;
482
482
username = _ . username ( username ) ;
483
483
// Send the command to the server and race the Promise against a delay..
484
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , `/vip ${ username } ` , ( resolve , reject ) => {
484
+ return this . _sendCommand ( null , channel , `/vip ${ username } ` , ( resolve , reject ) => {
485
485
// Received _promiseVip event, resolve or reject..
486
486
this . once ( '_promiseVip' , err => {
487
487
if ( ! err ) { resolve ( [ channel , username ] ) ; }
@@ -494,7 +494,7 @@ module.exports = {
494
494
vips ( channel ) {
495
495
channel = _ . channel ( channel ) ;
496
496
// Send the command to the server and race the Promise against a delay..
497
- return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , '/vips' , ( resolve , reject ) => {
497
+ return this . _sendCommand ( null , channel , '/vips' , ( resolve , reject ) => {
498
498
// Received _promiseVips event, resolve or reject..
499
499
this . once ( '_promiseVips' , ( err , vips ) => {
500
500
if ( ! err ) { resolve ( vips ) ; }
@@ -512,7 +512,7 @@ module.exports = {
512
512
return Promise . reject ( 'Cannot send a whisper to the same account.' ) ;
513
513
}
514
514
// Send the command to the server and race the Promise against a delay..
515
- return this . _sendCommand ( this . _getPromiseDelay ( ) , '#tmijs' , `/w ${ username } ${ message } ` , ( _resolve , reject ) => {
515
+ return this . _sendCommand ( null , '#tmijs' , `/w ${ username } ${ message } ` , ( _resolve , reject ) => {
516
516
this . once ( '_promiseWhisper' , err => {
517
517
if ( err ) { reject ( err ) ; }
518
518
} ) ;
0 commit comments