add reject
This commit is contained in:
parent
9358be43fc
commit
366c49a346
@ -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.0.0",
|
"version": "1.1.0",
|
||||||
"dependencies": [],
|
"dependencies": ["control?"],
|
||||||
"npmDependencies": []
|
"npmDependencies": []
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,11 @@ class IRCMessage implements IMessage {
|
|||||||
this.source.resolve(this, ...args);
|
this.source.resolve(this, ...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public reject(error: Error): void {
|
||||||
|
this.resolved = true;
|
||||||
|
this.source.resolve(this, error.message);
|
||||||
|
}
|
||||||
|
|
||||||
public mention(user: IMessageTarget): string {
|
public mention(user: IMessageTarget): string {
|
||||||
return user.name;
|
return user.name;
|
||||||
}
|
}
|
||||||
@ -247,13 +252,14 @@ class IRCServicePlugin extends Plugin {
|
|||||||
for (const ins of list) {
|
for (const ins of list) {
|
||||||
const newProto = new IRCProtocol(this, ins);
|
const newProto = new IRCProtocol(this, ins);
|
||||||
logger.log('[%s] Starting IRC service "%s".', this.name, ins.name);
|
logger.log('[%s] Starting IRC service "%s".', this.name, ins.name);
|
||||||
this.service?.use(newProto, true);
|
|
||||||
this.monitor(newProto);
|
this.monitor(newProto);
|
||||||
|
this.service?.use(newProto, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private monitor(proto: Protocol): void {
|
private monitor(proto: Protocol): void {
|
||||||
// TODO
|
proto.on('running', () => this.emit('protocolNew', proto));
|
||||||
|
proto.on('stopped', () => this.emit('protocolExit', proto));
|
||||||
}
|
}
|
||||||
|
|
||||||
private validateConfiguration(): any[] {
|
private validateConfiguration(): any[] {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
"name": "irc",
|
"name": "irc",
|
||||||
"version": "1.0.0"
|
"version": "1.1.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ircprototest",
|
"name": "ircprototest",
|
||||||
|
Loading…
Reference in New Issue
Block a user