yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.35k stars 1.52k forks source link

Launching web app from inline mode #1091

Closed Sladrus closed 1 year ago

Sladrus commented 1 year ago

image

Hello, how i can launching web app from inline mode? need that button "make custom order"

raskyer commented 1 year ago

This depends on support of Telegram's version 6.7 and this library supports up to 6.3.

Even Telegraf is stuck to 6.5 : https://github.com/telegraf/telegraf/issues/1835 So for now, no support until 6.7 is reached.

The only solution if you really need it is to use the python library (which has a way bigger community).

danielperez9430 commented 1 year ago

You don't need to update the library for use the button in the answerInlineQuery, because is a optional param and this library support this optional params out the box.

InlineQueryResultsButton: A JSON-serialized object describing a button to be shown above inline query results

Example:

// For add more params in the object https://core.telegram.org/bots/api#inlinequeryresultsbutton (In this case only "text" is mandatory

const InlineQueryResultsButton = { text: "Something" }

answerInlineQuery(inline_query_id, results, { button: JSON.parse(InlineQueryResultsButton) })
Sladrus commented 1 year ago

There is a problem that everything opens on a PC and Android, but on an iPhone the button is simply clicked and nothing happens

KnorpelSenf commented 1 year ago

The only solution if you really need it is to use the python library (which has a way bigger community).

This is just wrong, the python community may be large but they don't exactly release faster updates than some JS libs. I know it because I wrote one, and we almost always ship an update less than 24 hours after the Bot API release. For example, PTB was more than two weeks late.

raskyer commented 1 year ago

The only solution if you really need it is to use the python library (which has a way bigger community).

This is just wrong, the python community may be large but they don't exactly release faster updates than some JS libs. I know it because I wrote one, and we almost always ship an update less than 24 hours after the Bot API release. For example, PTB was more than two weeks late.

I wasn't aware of this library. Great to see solutions for node community.

danielperez9430 commented 1 year ago

The problem was more the 2 braking changes from Telegram the "createNewStickerSet" and "addStickerToSet". That required more work because need to change the way that the data was send. In other case the release can be do in the same date. If I have a little more time this weekend I maybe finish this last two things in the pull request https://github.com/yagop/node-telegram-bot-api/pull/1069