diff --git a/src/telegram.js b/src/telegram.js index f885ae8..f5902da 100644 --- a/src/telegram.js +++ b/src/telegram.js @@ -1681,6 +1681,13 @@ class TelegramBot extends EventEmitter { return this._textRegexpCallbacks.splice(index, 1)[0]; } + /** + * Remove all listeners registered with `onText()`. + */ + clearTextListeners() { + this._textRegexpCallbacks = []; + } + /** * Register a reply to wait for a message response. * @param {Number|String} chatId The chat id where the message cames from. @@ -1717,6 +1724,13 @@ class TelegramBot extends EventEmitter { return this._replyListeners.splice(index, 1)[0]; } + /** + * Removes all replies that have been prev. registered for a message response. + */ + clearReplyListeners() { + this._replyListeners = []; + } + /** * Use this method to get up to date information about the chat * (current name of the user for one-on-one conversations, current