UNPKG

@apidog/multibot-sdk-ts

Version:
21 lines 585 B
"use strict"; 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