warn when nickserv command fails
This commit is contained in:
parent
7ec9cead2a
commit
6065dd55e3
13
irc/irc.ts
13
irc/irc.ts
@ -3,6 +3,7 @@ import tls, { TLSSocket } from 'tls';
|
||||
import net, { Socket } from 'net';
|
||||
import { IIRCLine, parse } from './parser';
|
||||
import { EventEmitter } from 'events';
|
||||
import { logger } from '@squeebot/core/lib/core';
|
||||
const MAXMSGLEN = 512;
|
||||
|
||||
export interface IIRCOptions {
|
||||
@ -119,8 +120,18 @@ export class IRC extends EventEmitter {
|
||||
}
|
||||
|
||||
const splitline = line.trailing.trim().split(' ');
|
||||
const authNumber = parseInt(splitline[2], 10);
|
||||
|
||||
let result = false;
|
||||
if (splitline[2] !== '0') {
|
||||
if (isNaN(authNumber)) {
|
||||
this.options.nickserv.enabled = false;
|
||||
data.func(false);
|
||||
logger.warn(`[IRC] ${this.options.host} does not seem to support NickServ ${this.options.nickserv.command}`);
|
||||
logger.warn(`[IRC] Their reply was: ${line.trailing}`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (authNumber > 0) {
|
||||
result = true;
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
"name": "irc",
|
||||
"description": "IRC Service for Squeebot 3",
|
||||
"tags": ["service", "irc"],
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"dependencies": ["control?"],
|
||||
"npmDependencies": []
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
"plugins": [
|
||||
{
|
||||
"name": "irc",
|
||||
"version": "1.2.0"
|
||||
"version": "1.2.1"
|
||||
},
|
||||
{
|
||||
"name": "ircprototest",
|
||||
|
Loading…
Reference in New Issue
Block a user