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 net, { Socket } from 'net';
|
||||||
import { IIRCLine, parse } from './parser';
|
import { IIRCLine, parse } from './parser';
|
||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'events';
|
||||||
|
import { logger } from '@squeebot/core/lib/core';
|
||||||
const MAXMSGLEN = 512;
|
const MAXMSGLEN = 512;
|
||||||
|
|
||||||
export interface IIRCOptions {
|
export interface IIRCOptions {
|
||||||
@ -119,8 +120,18 @@ export class IRC extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const splitline = line.trailing.trim().split(' ');
|
const splitline = line.trailing.trim().split(' ');
|
||||||
|
const authNumber = parseInt(splitline[2], 10);
|
||||||
|
|
||||||
let result = false;
|
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;
|
result = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "irc",
|
"name": "irc",
|
||||||
"description": "IRC Service for Squeebot 3",
|
"description": "IRC Service for Squeebot 3",
|
||||||
"tags": ["service", "irc"],
|
"tags": ["service", "irc"],
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"dependencies": ["control?"],
|
"dependencies": ["control?"],
|
||||||
"npmDependencies": []
|
"npmDependencies": []
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
"name": "irc",
|
"name": "irc",
|
||||||
"version": "1.2.0"
|
"version": "1.2.1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ircprototest",
|
"name": "ircprototest",
|
||||||
|
Loading…
Reference in New Issue
Block a user