Any way to open an app from Telegram bot?
Asked Answered
D

5

5

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!

Dichroic answered 14/11, 2018 at 11:4 Comment(3)
Why do you want that? What you expected to do is a very malicious action...Silk
It really wasn't my intention but I see the point. Thanks.Dichroic
@Dichroic Maybe you can make the magnet links "clickable"? Like a pasted URL which will take you to the default browser once you click on it. Or is this working already and you really just wanted the app to automatically open?Matterhorn
G
6

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.

Gladden answered 29/12, 2019 at 22:14 Comment(0)
C
2

A bot can't open an external app

Contrariety answered 24/11, 2018 at 11:22 Comment(0)
M
0

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.

Matterhorn answered 2/12, 2018 at 21:5 Comment(0)
D
0

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.

Doubleedged answered 8/8, 2021 at 16:40 Comment(1)
This is basically what was proposed here https://mcmap.net/q/1979266/-any-way-to-open-an-app-from-telegram-botSlowwitted
A
0

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}
Anjanette answered 12/6, 2023 at 19:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.