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