2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-29 13:27:44 +00:00

fix regexp compare (#783)

* fix regexp compare

* npm run doc

* docs: fix

Co-authored-by: Mohammed Sohail <sohailsameja@gmail.com>
This commit is contained in:
German Smirnov 2020-05-12 07:20:52 +03:00 committed by GitHub
parent b4309cf45a
commit d853a18079
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1609,7 +1609,7 @@ class TelegramBot extends EventEmitter {
*/
removeTextListener(regexp) {
const index = this._textRegexpCallbacks.findIndex((textListener) => {
return textListener.regexp === regexp;
return String(textListener.regexp) === String(regexp);
});
if (index === -1) {
return null;