Skip to content

symfony/telegram-notifier does not support local telegram api server #57766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
BaHeK1994 opened this issue Jul 18, 2024 · 7 comments · May be fixed by #57769
Open

symfony/telegram-notifier does not support local telegram api server #57766

BaHeK1994 opened this issue Jul 18, 2024 · 7 comments · May be fixed by #57769

Comments

@BaHeK1994
Copy link

Description

You can use the local telegram API server by installing it according to the instructions: https://github.com/tdlib/telegram-bot-api

Sending requests via the local server is faster, but you cannot change the API link, it is always used http://api.telegram.org

Example

No response

@fabpot
Copy link
Member

fabpot commented Jul 18, 2024

Do you want to work on a Pr to make that configurable?

@ahmedghanem00
Copy link
Contributor

Have you tried to modify the bridge DSN within the ENV file?

TELEGRAM_DSN=telegram://TOKEN@default?channel=CHAT_ID

A replacement for "default" keyword by the desired domain/URL should achieve what you want.

@BaHeK1994
Copy link
Author

A replacement for "default" keyword by the desired domain/URL should achieve what you want.

But this does not support http url, https only
https://github.com/symfony/telegram-notifier/blob/7.1/TelegramTransport.php#L108

@ahmedghanem00
Copy link
Contributor

I see. You may propose a PR then to modify this behavior.

I think removing the https from the line you've mentioned and move it up to the HOST constant may allow overriding the protocol in the DSN?

TELEGRAM_DSN=telegram://TOKEN@http://localhost:8081?channel=CHAT_ID

Have not tested this yet, but just sharing my thoughts.

@BaHeK1994
Copy link
Author

In CurlResponse.php line 315:
                                                                                                                 
  Could not resolve host: http for "https://http/bot.../sendMessage". 

@BaHeK1994
Copy link
Author

I can do PR, but without tests

@ahmedghanem00
Copy link
Contributor

I can do PR, but without tests

I'll make a PR for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants