mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-22 01:47:25 +00:00
fix: RegexExp in process messges updates
This commit is contained in:
parent
5385d41f1f
commit
4fa9a735bb
@ -686,6 +686,11 @@ class TelegramBot extends EventEmitter {
|
||||
debug('Text message');
|
||||
this._textRegexpCallbacks.some(reg => {
|
||||
debug('Matching %s with %s', message.text, reg.regexp);
|
||||
|
||||
if (!(reg.regexp instanceof RegExp)) {
|
||||
reg.regexp = new RegExp(reg.regexp);
|
||||
}
|
||||
|
||||
const result = reg.regexp.exec(message.text);
|
||||
if (!result) {
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user