some changes
This commit is contained in:
parent
9c6a31e765
commit
cf43d997d5
@ -210,6 +210,7 @@ class SqueebotCommandsAPIPlugin extends Plugin {
|
||||
// Done
|
||||
}
|
||||
|
||||
@EventListener('message')
|
||||
public digest(msg: IMessage): void {
|
||||
if (msg.type !== EMessageType.message) {
|
||||
return;
|
||||
@ -333,10 +334,11 @@ class SqueebotCommandsAPIPlugin extends Plugin {
|
||||
withAliases.push(spec);
|
||||
}
|
||||
|
||||
const matching = this.roomMatcher(msg, withAliases);
|
||||
// Iteration 2: Match rooms for message
|
||||
let matching = this.roomMatcher(msg, withAliases);
|
||||
|
||||
// Iteration 2: Match permissions for user
|
||||
// TODO: permission matching
|
||||
// Iteration 3: Match permissions for user
|
||||
matching = this.permissionMatcher(msg, matching);
|
||||
|
||||
const text = msg.data.text ? msg.data.text : msg.data;
|
||||
const argv = text.toLowerCase().split(' ');
|
||||
@ -405,17 +407,14 @@ class SqueebotCommandsAPIPlugin extends Plugin {
|
||||
this.permissions = null;
|
||||
}
|
||||
|
||||
@EventListener('message')
|
||||
messageHandler(msg: IMessage): void {
|
||||
this.digest(msg);
|
||||
}
|
||||
|
||||
@EventListener('pluginUnload')
|
||||
unloadEventHandler(plugin: string | Plugin): void {
|
||||
if (plugin === this.name || plugin === this) {
|
||||
logger.debug('[%s] shutting down..', this.name);
|
||||
this.config.save().then(() =>
|
||||
this.emit('pluginUnloaded', this));
|
||||
} else {
|
||||
this.unregisterPlugin((typeof plugin === 'string' ? plugin : plugin.manifest.name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user