[GH-ISSUE #86] Handle Telegram edge cases #25

Open
opened 2026-02-26 05:32:29 +03:00 by kerem · 9 comments
Owner

Originally created by @ChristophWurst on GitHub (Aug 7, 2018).
Original GitHub issue: https://github.com/nextcloud/twofactor_gateway/issues/86

In order to stabilize the Telegram integration, it needs a few fixes in its gateway implementation that handle edge cases.

Originally created by @ChristophWurst on GitHub (Aug 7, 2018). Original GitHub issue: https://github.com/nextcloud/twofactor_gateway/issues/86 In order to stabilize the Telegram integration, it needs a few fixes in its gateway implementation that handle edge cases.
Author
Owner

@ChristophWurst commented on GitHub (Aug 28, 2018):

Btw, @djpremier , see the new admin documentation for more info on how to set this up: https://github.com/nextcloud/twofactor_gateway/tree/master/doc/admin#telegram.

<!-- gh-comment-id:416556095 --> @ChristophWurst commented on GitHub (Aug 28, 2018): Btw, @djpremier , see the new admin documentation for more info on how to set this up: https://github.com/nextcloud/twofactor_gateway/tree/master/doc/admin#telegram.
Author
Owner

@ChristophWurst commented on GitHub (Aug 28, 2018):

Basically github.com/nextcloud/twofactor_gateway@ce47ec9b67/lib/Service/Gateway/Telegram/Gateway.php (L90).

<!-- gh-comment-id:416561287 --> @ChristophWurst commented on GitHub (Aug 28, 2018): Basically https://github.com/nextcloud/twofactor_gateway/blob/ce47ec9b6752b1ea46e1153e64b0c09c0e30da8f/lib/Service/Gateway/Telegram/Gateway.php#L90.
Author
Owner

@djpremier commented on GitHub (Aug 28, 2018):

Thanks Christoph, I already started the conversation with the button, in the case of '/start', and still I get the error.

<!-- gh-comment-id:416563084 --> @djpremier commented on GitHub (Aug 28, 2018): Thanks Christoph, I already started the conversation with the button, in the case of '/start', and still I get the error.
Author
Owner

@djpremier commented on GitHub (Aug 28, 2018):

Now I'm on the computer, I can give you more details.

Following @ChristophWurst , the process was basically this:

I installed the app
I have read the documentation
I created the bot and started the conversation '/ start'
I configured via 'occ' the gateway
I went back to my settings panel and added my number
I get the error in the same place and also in the log, as you can see in the screenshots

telegram gateway error
telegram gateway error log

telegram gateway error bot

<!-- gh-comment-id:416566743 --> @djpremier commented on GitHub (Aug 28, 2018): Now I'm on the computer, I can give you more details. Following @ChristophWurst , the process was basically this: I installed the app I have read the documentation I created the bot and started the conversation '/ start' I configured via 'occ' the gateway I went back to my settings panel and added my number I get the error in the same place and also in the log, as you can see in the screenshots ![telegram gateway error](https://user-images.githubusercontent.com/17091381/44723005-30367080-aaa5-11e8-838e-098c26e62f33.png) ![telegram gateway error log](https://user-images.githubusercontent.com/17091381/44723104-712e8500-aaa5-11e8-8a31-1fa514a1e7c0.png) ![telegram gateway error bot](https://user-images.githubusercontent.com/17091381/44723053-50662f80-aaa5-11e8-9960-5e8ae826a370.png)
Author
Owner

@ChristophWurst commented on GitHub (Aug 28, 2018):

and added my number

Did you enter your phone number or the chat id from the id bot?

<!-- gh-comment-id:416576693 --> @ChristophWurst commented on GitHub (Aug 28, 2018): > and added my number Did you enter your phone number or the chat id from the *id bot*?
Author
Owner

@djpremier commented on GitHub (Aug 28, 2018):

Phone number

<!-- gh-comment-id:416621648 --> @djpremier commented on GitHub (Aug 28, 2018): Phone number
Author
Owner

@ChristophWurst commented on GitHub (Aug 28, 2018):

Get your ID via this bot and enter that is identifier.

<!-- gh-comment-id:416622983 --> @ChristophWurst commented on GitHub (Aug 28, 2018): Get your ID via [this bot](https://telegram.me/get_id_bot) and enter that is identifier.
Author
Owner

@djpremier commented on GitHub (Aug 28, 2018):

Thank you, it worked! But it is strange that you have placed the requested message to enter the phone number, since what should be placed is chat_id.

Another alternative is to send the message of / start and access:

https://api.telegram.org/bot<token>/getUpdates

There you will have access to id

I think it would be interesting if possible to mount this mini tutorial there in docs 😉

<!-- gh-comment-id:416638900 --> @djpremier commented on GitHub (Aug 28, 2018): Thank you, it worked! But it is strange that you have placed the requested message to enter the phone number, since what should be placed is chat_id. Another alternative is to send the message of / start and access: `https://api.telegram.org/bot<token>/getUpdates` There you will have access to id I think it would be interesting if possible to mount this mini tutorial there in docs 😉
Author
Owner

@ChristophWurst commented on GitHub (Aug 28, 2018):

Another alternative is to send the message of / start and access:

https://api.telegram.org/bot/getUpdates

That's exactly what this app does internally. But with that info alone, you have no mapping of Nextcloud and Telegram users. Users have to enter their chat id.

The steps will be documented in the UI starting with the next release. Ref #82.

<!-- gh-comment-id:416642974 --> @ChristophWurst commented on GitHub (Aug 28, 2018): > Another alternative is to send the message of / start and access: > > https://api.telegram.org/bot<token>/getUpdates That's exactly what this app does internally. But with that info alone, you have no mapping of Nextcloud and Telegram users. Users *have to* enter their chat id. The steps will be documented in the UI starting with the next release. Ref #82.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/twofactor_gateway-nextcloud#25
No description provided.