Code Monkey home page Code Monkey logo

Comments (2)

Syfaro avatar Syfaro commented on July 28, 2024

This issue came up before, #52

As I told them, the whole function is only a few lines of code so I'd suggest just implementing such a function yourself with your custom method for stopping. Given that the provided updates function is somewhat opinionated (how it logs errors and hardcoded time delay), it's not unreasonable to expect others to rewrite it anyway. I'd especially not like to break compatibility with older versions for a feature few people are likely to use.

from telegram-bot-api.

sandler31 avatar sandler31 commented on July 28, 2024

Oh, I see, didn't find that issue before.
The problem is, at least from what I understand, that it's not really possible to create an external method that will stop the update loop, as it starts a goroutine with an infinite loop without a break statement anywhere.
The only way would be to recreate the GetUpdatesChan method outside the package, but that is somewhat weird, imho.
Why are you against having a stop method inside the package?
I understand the considetaion of not breaking API for existing users, but from the PR I suggested I don't see how that could happen.
Of course I might be missing something there, in that case, I'd be happy to fix that. I just think that support for new features that don't break anything for existing users, is a good thing to consider :)

from telegram-bot-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.