extensions icon indicating copy to clipboard operation
extensions copied to clipboard

Add telegram-raycast extension

Open noxlovette opened this issue 1 year ago • 14 comments

Description

Screencast

Checklist

noxlovette avatar Jun 18 '24 11:06 noxlovette

Congratulations on your new Raycast extension! :rocket:

We have a lower capacity at the moment, and extension reviews might take longer than usually to get the initial review. Once the PR is approved and merged, the extension will be available on our Store.

Sorry for the inconvenience

raycastbot avatar Jun 18 '24 11:06 raycastbot

Hello, Raycast Team! I am excited to be here.

  1. I did try to adhere to the requirements specified in the UI guidelines. I wish logging into Telegram was possible simply via login/password. The phone number has to be sent to TG servers, and the user then has to submit the code on their own.
  2. I also tried to define a Telegram Bot that would yield the session string directly to the chat with the user. However, Telgram blocks a connection attempt when it spots that the login code has been sent elsewhere.
  3. The proxy server I have created does not store any user data. The session identifier is stored in Raycast only.
  4. I chose to use proxy because a client can only be created using unique API_ID and API_HASH, secret values issues at my.telegram.org, and the only thing the proxy does is enrich received requests with these values. I have seen another pull request with Telegram that would require the user to create their own pair of these secret values – this is not optimal in my view.

noxlovette avatar Jun 18 '24 11:06 noxlovette

Add telegram extension https://github.com/raycast/extensions/pull/12477 image

koinzhang avatar Jun 18 '24 11:06 koinzhang

Add telegram extension #12477 image

Hello! Yes, I am aware of this extension. His code relies on identifiers available only through a series of additional steps that my code does not require, and I would have to suggest rewriting his code completely to make the experience more user-friendly, which would be strange considering that the extension has not been published and is, too, under review.

I invite you to study my logic to logging into Telegram or even try for yourself to understand the difference.

The linted code is forthcoming, sorry about overseeing that.

noxlovette avatar Jun 18 '24 12:06 noxlovette

It seems like both are trying to do the same job but using two different approaches, is that correct?

Maybe you should work with @SurajMeena so we end up with only one extension

pernielsentikaer avatar Jun 24 '24 11:06 pernielsentikaer

It seems like both are trying to do the same job but using two different approaches, is that correct?

Maybe you should work with @SurajMeena so we end up with only one extension

Hi @noxlovette I am up for collaborating on this extension, maybe we could connect once and discuss how the implementation and features should look like

SurajMeena avatar Jun 24 '24 17:06 SurajMeena

It seems like both are trying to do the same job but using two different approaches, is that correct? Maybe you should work with @SurajMeena so we end up with only one extension

Hi @noxlovette I am up for collaborating on this extension, maybe we could connect once and discuss how the implementation and features should look like

That sounds great to me! Could you just text me on Telegram, please? https://t.me/noxlovette? I can't wait to get our mutual extension up and running.

noxlovette avatar Jun 24 '24 17:06 noxlovette

That's so nice to see, let's get the best approaches from them both and unite 🔥

pernielsentikaer avatar Jun 25 '24 06:06 pernielsentikaer

That's so nice to see, let's get the best approaches from them both and unite 🔥

Hi @pernielsentikaer , We needed your help in figuring out whether the proxy approach used in this PR aligns with raycast's standards and requirements for an extension to get published, So that we can make an informed choice for what things needs rearranging for final telegram extension

SurajMeena avatar Jun 25 '24 15:06 SurajMeena

That's so nice to see, let's get the best approaches from them both and unite 🔥

Hello @pernielsentikaer!

We have had a very productive day today and are excited to announce that we would like to see this PR request shipped to Raycast with both our names as collaborators.

Please let us know if using proxy is not a done thing, as previously asked by Suraj. It was my idea, I saw the Notion extension handling authentication similarly. The server code can be found here: https://github.com/noxlovette/telegram-proxy. It does not store any user data, only sends a sessionString, a unique, encrypted session identifier, to the extension over HTTPS, where it is stored in localStorage.

Do let us know if there are things we can further optimise.

noxlovette avatar Jun 25 '24 18:06 noxlovette

If a proxy is needed, we want to host it ourselves to maintain control of it. Otherwise, we don't know what's going on. We don't want to deploy a Bun app. Can it be rewritten with Node.js and Fastify or something similar? 😊

pernielsentikaer avatar Jun 26 '24 08:06 pernielsentikaer

If a proxy is needed, we want to host it ourselves to maintain control of it. Otherwise, we don't know what's going on. We don't want to deploy a Bun app. Can it be rewritten with Node.js and Fastify or something similar? 😊

Will be done. 🤝

noxlovette avatar Jun 26 '24 10:06 noxlovette

@pernielsentikaer, I have added a branch called 'express' to the proxy code. Hope this works.

The extension code needs to know how to reach the server. Could you share the URL with me somehow so that I could change the variable in the telegram-login file? Also, that would mean setting up two .env variables – API_ID and API_HASH. I guess I could share mine over Doppler?

noxlovette avatar Jun 26 '24 12:06 noxlovette

This pull request has been automatically marked as stale because it did not have any recent activity.

It will be closed if no further activity occurs in the next 7 days to keep our backlog clean 😊

raycastbot avatar Jul 10 '24 12:07 raycastbot

This issue has been automatically closed due to inactivity.

Feel free to comment in the thread when you're ready to continue working on it 🙂

You can also catch us in Slack if you want to discuss this.

raycastbot avatar Jul 17 '24 12:07 raycastbot