Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stopPolling method #51

Closed
wants to merge 1 commit into from
Closed

Conversation

smmoosavi
Copy link

usage:

var bot = new TelegramBot(token, {});

bot.initPolling(); // polling started

bot.initPolling(); // polling restart

bot.stopPolling(); // new method: polling stoped

@conorfennell conorfennell mentioned this pull request Mar 21, 2016
@phillipadsmith
Copy link

@yagop Any timeline on merging in one of the two PRs to implement a stopPolling method?

@smmoosavi smmoosavi force-pushed the patch-1 branch 2 times, most recently from 13c073a to 16ef13b Compare April 27, 2016 07:40
@yagop
Copy link
Owner

yagop commented Apr 27, 2016

This can be achieved by:

this._polling.abort = true;
this._polling.lastRequest.cancel('Stop polling');

Which is what the stopPolling does.

@phillipadsmith
Copy link

This can be achieved by:

Yes, I realize that, and yet I'm wondering why there is not stopPolling() method in node-telegram-bot-api when there are two PRs in the queue that propose implementing it? Is there a reason not to have a stopPolling() method?

@icdevin
Copy link

icdevin commented Apr 27, 2016

I kind of agree, and really the ._polling typically denotes an internal property, which you typically want to avoid calling or setting if you can help it.

Just for my own knowledge, what is the use case for this...? I saw somewhere else saying there's some issues with messages getting caught and looping, offsets acting funny and such?

@smmoosavi
Copy link
Author

smmoosavi commented May 6, 2016

until this and other poll request (#118) merged, you can use this monkey patch

@phillipadsmith
Copy link

@yagop Bump.

@GochoMugo
Copy link
Collaborator

This has already been implemented in our codebase. Thanks for your time and effort.

@GochoMugo GochoMugo closed this Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants