-
Notifications
You must be signed in to change notification settings - Fork 9
Devel #5
Conversation
LICENCE.md
Outdated
|
||
Version 3, 19 November 2007 | ||
Copyright 2009 Twitter, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol bad copy past ;/
src/core/bot.ts
Outdated
// it's an integration | ||
if (instance.listen) { | ||
this.logger.info({ method: 'use', message: `Integration: ${instance.serviceName()}` }); | ||
this.addIntegration(instance); | ||
} else if (instance.receive || instance.send) { // Middleware | ||
if (instance.receive) { | ||
} else if (instance.incoming || instance.outgoing) { // Middleware |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could drop these as you do it again right after.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this, does it make sense?
public use(instance: any, filter?: string | string[]): void {
// it's an integration
if (instance.listen) {
this.logger.info({ method: 'use', message: `Integration: ${instance.serviceName()}` });
this.addIntegration(instance);
} else if(instance.incoming) {
this.logger
.info({ method: 'use', message: `incoming middleware: ${instance.serviceName()}` });
this.incomingMiddlewares.push({
name: `${instance.serviceName()}.incoming`,
middleware: instance,
filter: filter || null,
});
} else if (instance.outgoing) { // Middleware
this.logger
.info({ method: 'use', message: `outgoing middleware: ${instance.serviceName()}` });
this.outgoingMiddlewares.push({
name: `${instance.serviceName()}.outgoing`,
middleware: instance,
filter: filter || null,
});
}
return;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 tired ;p
} from './interfaces'; | ||
|
||
const isObservable = (obs:any): boolean => obs && typeof obs.subscribe === 'function'; | ||
const isPromise = (obj:any): boolean => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does obj instanceof Promise
not work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes is not work, weird...
No description provided.