Discussion of article "How to create bots for Telegram in MQL5" - page 27

 

I would like to ask those who are unable to run Telegram via WebRequest to run this script and copy here the line from the Experts tab with the result. This will help to quickly identify the problem.

Документация по MQL5: Сетевые функции / WebRequest
Документация по MQL5: Сетевые функции / WebRequest
  • www.mql5.com
Для использования функции WebRequest() следует добавить адреса серверов в список разрешенных URL во вкладке "Советники" окна "Настройки". Порт сервера выбирается автоматически на основе указанного протокола - 80 для "http://" и 443 для "https://". Функция WebRequest() является синхронной, это означает, что она приостанавливает выполнение...
 
Andrey Voytenko:

I would like to ask those who are unable to run Telegram via WebRequest to run this script and copy here the line from the Experts tab with the result. This will help to quickly identify the problem.

2020.06.05 18:06:36.033 WebRequest_Test_Script (EURUSD.gl,H4) Build=2470 WebRequest=1001 GetLastError=5203 strData=


 

I got the same result. And it's the same for everyone if the API is unavailable.

It has been like this for a year. The only way out is if the developers let all traffic, not just quotes, through the proxy from the terminal settings. I asked once, but they didn't answer me.

 
Gennady Mazur:

2020.06.05 18:06:36.033 WebRequest_Test_Script (EURUSD.gl,H4) Build=2470 WebRequest=1001 GetLastError=5203 strData=

@Gennady Mazur Try running in the command line:

curl -X POST https://api.telegram.org/bot177791741:AAEcSxsNEu8625Y2I4KAw_H7yGev9tl8uJg/getMe
 
Edgar Akhmadeev:

I got the same result. And it will be the same for everyone if the API is unavailable.

It has been like this for a year. The only way out is if the developers let all traffic, not just quotes, through the proxy from the terminal settings. I asked once, but they didn't answer me.

@Edgar Akhmadeev We are trying to reproduce the situation when WebRequest fails but curl is fine. Try making a request through curl. Example above.

 
Andrey Voytenko:

@Edgar Akhmadeev We are trying to reproduce the situation when WebRequest fails but curl is fine. Try making a request through curl. Example above.

curl: (28) Failed to connect to api.telegram.org port 443: Timed out

 
Phindile Victoria Qwabe:

Still does not work ,for inpChannelName do you still use the channel Name or chat ID ?

Chat ID
 
Andrey Voytenko:

@Gennady Mazur And try running at the command line:

curl -X POST https://api.telegram.org/bot177791741:AAEcSxsNEu8625Y2I4KAw_H7yGev9tl8uJg/getMe

I don't want to execute
from Windows, but from MAC here is

{"ok":true,"result":{"id":177791741,"is_bot":true,"first_name":"ForexSignal","username":"ForexSignalBot","can_join_groups":true,"can_read_all_group_messages":true,"supports_inline_queries":true}}

 
Gennady Mazur:

I don't want to execute it from within Windows.

If this result:

2020.06.05 18:06:36.033 WebRequest_Test_Script (EURUSD.gl,H4) Build=2470 WebRequest=1001 GetLastError=5203 strData=

You got on Windows system, then, for the purity of the experiment, please put curl for Windows https://curl.haxx.se/windows/.

curl for Windows
  • curl.haxx.se
These are the latest and most up to date official curl binary builds for Microsoft Windows. curl version : 7.70.0 Build : 7.70.0_1 Date : 2020-04-29 Changes : 7.70.0 changelog Packages curl for 64 bit Size: 3.2 MB sha256: c9ea2abc80b78e65f9eebe155272c7f27a80a264fe926a398aa5b48d4f5b4e0e curl for 32 bit Size: 3.0 MB sha256...
 
Andrey Voytenko:

@Gennady Mazur And try running at the command line:

curl -X POST https://api.telegram.org/bot177791741:AAEcSxsNEu8625Y2I4KAw_H7yGev9tl8uJg/getMe
{"ok":true,"result":{"id":177791741,"is_bot":true,"first_name":"ForexSignal","username":"ForexSignalBot","can_join_groups":true,"can_read_all_group_messages":true,"supports_inline_queries":true}}