telebot icon indicating copy to clipboard operation
telebot copied to clipboard

Add possibility to use express as server (or any other)

Open Fuzzyma opened this issue 8 years ago • 2 comments

I came across the problem that I need to use an express server for my application but want to use webhook, too. It would be cool, to have the ability to do so. The webhook.js just needs some minor changes for that:

    if(opt.server) {
        server.listen(opt.server);
        // this could be added in case the framework accepts routes like this (e.g. express)
        // or the user has to add this route manually and call receiveUpdates
        opt.server.post(botUrl + token, listener)
        return
    }

And now we gave the server control to the user in case he wants to use the server for something else. What do you think about that?

Fuzzyma avatar Dec 10 '17 23:12 Fuzzyma

@Fuzzyma What about trying your chance and add a PR for this feature? :+1:

mehrancodes avatar Dec 29 '17 14:12 mehrancodes

Let's see if I can find the time to do so

Fuzzyma avatar Dec 29 '17 16:12 Fuzzyma