@apidog/multibot-sdk-ts
Version:
Telegram and VK bot SDK for TypeScript
21 lines • 585 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Matcher = void 0;
class Matcher {
constructor(bot, rules) {
this.rules = [];
/**
* Add rule for match
*/
this.add = (item) => {
if (!this.rules.includes(item)) {
this.rules.push(item);
}
};
this.getMatches = (update) => this.rules.filter(rule => rule.test(update, this.bot));
this.bot = bot;
this.rules = rules;
}
}
exports.Matcher = Matcher;
//# sourceMappingURL=matcher.js.map