n40k1
n40k1

Reputation: 59

Any way to open an app from Telegram bot?

I've coded a Telegram bot (python-telegram-bot) and I would like to know if there's a way to open an app from the bot.

To be more accurate, the bot searches torrent links and the original idea was to send that links directly to qBitTorrent in the user's computer but unfortunately I'm stuck in that step, so for the moment I though about give the user the magnet link so it can be pasted in the qBitTorrent app. The thing is that it would great to automaticly open the app from the bot.

Thanks in advance!

Upvotes: 5

Views: 7329

Answers (5)

mr.bug
mr.bug

Reputation: 402

maybe there is a trick or something like that. to create an html link at runtime or redirect links? (this is an example and is not working... )

http://127.0.0.1/<body><a href="app://link">open app</a></body>

or like this:

127.0.0.1/href=app://link

or like this:

127.0.0.1/href={app://link}

Upvotes: 0

thoo
thoo

Reputation: 19

I was also trying to do this, but that was not possible. But as workaround you can make a simple site that opens the app and make Telegram open that.

Upvotes: 0

Artur Barsegyan
Artur Barsegyan

Reputation: 161

I've also stuck on this problem. I've tried to open another app via URI, for example:

things://add?title=My%20new%20task

The example above shows my try to open the macOS application called Things.

The main answer is: Telegram doesn't allow to open external applications from bot and doesn't allow use any protocol in URI, except for http and tg.

I think, you can use 3rd-party (or your one) service, which will redirect you on any page that you will ask. Your URL may be a URI to your app: your mobile/PC browser can redirect you directly to the app.

Upvotes: 6

finefoot
finefoot

Reputation: 11272

Generally speaking, you're right: one Android app is able to start another app.

However, in this case, this is not your app, we're talking about, but you want another app (Telegram) to open another app. So you have to rely on what that app (Telegram) provides you with their API.

You can have a look at Telegram's bot API at https://core.telegram.org/bots/api There is no method to execute commands or open another app. So it will not be possible for you to open another app with your Telegram bot.

Upvotes: 0

91DarioDev
91DarioDev

Reputation: 1700

A bot can't open an external app

Upvotes: 2

Related Questions