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

 
Andrey Voytenko:

I ask everyone who has error 1001.

Please run this script and paste here the line from the Experts tab with the result.

An example:

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

Additionally describe your operating system

Windows 7 7601 SP1

This will help to solve this problem.

First of all, Thank you Andrey for the reply.

This is the output of my script named "t0.mql5":

2020.06.07 09:27:29.537 t0 (EURUSD,H1)  Build=2475 WebRequest=1001 GetLastError=5203 strData=


  • OS:
     Windows 10 Pro 64 bit
     command line "ver" command returns: Microsoft Windows [Version 10.0.18362.778]
  • Metatrader 5, Build 2475
  • and for "GetLastError=5203" which means HTTP request failed: I have no Firewall Software installed( I just have a free version of bitdefender Antivirus which has never  made a problem).
  • I recheck these things:  1)the token in BotFather, 2) Tools\Options\"Allow web request" and  the relevant addresses. 3) I used a "VPN" service too to check but nothing changed. 4) turned off Windows firewall .
Documentation on MQL5: Network Functions / WebRequest
Documentation on MQL5: Network Functions / WebRequest
  • www.mql5.com
To use the WebRequest() function, add the addresses of the required servers in the list of allowed URLs in the "Expert Advisors" tab of the "Options" window. Server port is automatically selected on the basis of the specified protocol - 80 for "http://" and 443 for "https://". The WebRequest() function is synchronous, which means its breaks the...
 

@aboozar sobboohi Please run this request in command prompt and paste here your result. If you dont have cURL please install from here https://curl.haxx.se/windows/

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

aboozar sobboohi
aboozar sobboohi
  • www.mql5.com
Trader's profile
 
Andrey Voytenko:

@aboozar sobboohi Please run this request in command prompt and paste here your result. If you dont have cURL please install from here https://curl.haxx.se/windows/

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

I was not used to curl. it had no "Setup.exe". Just extracted an ran it with both your an my own tokens!

C:\t_SM\Telegram_mql5\curl-7.70.0_1-win64-mingw\curl-7.70.0-win64-mingw\bin>curl -X POST https://api.telegram.org/bot177791741:AAEcSxsNEu8625Y2I4KAw_H7yGev9tl8uJg/getMe
curl: (7) Failed to connect to api.telegram.org port 443: Connection refused

C:\t_SM\Telegram_mql5\curl-7.70.0_1-win64-mingw\curl-7.70.0-win64-mingw\bin>curl -X POST https://api.telegram.org/bot996256588:AAH2yUhFSjexpOUxxj2ZLOmRQXXItAF-B_4/getMe
curl: (7) Failed to connect to api.telegram.org port 443: Connection refused

SOLVED  "Error: Unknown error 1001" =======>  my ISP Problem.

Now I have this outputs from cURL and Webrequest tester:

C:\t_SM\Telegram_mql5\curl-7.70.0_1-win64-mingw\curl-7.70.0-win64-mingw\bin>curl -X POST https://api.telegram.org/bot996256588:AAH2yUhFSjexpOUxxj2ZLOmRQXXItAF-B_4/getMe
{"ok":true,"result":{"id":996256588,"is_bot":true,"first_name":"Signal1","username":"Signal1bot","can_join_groups":true,"can_read_all_group_messages":false,"supports_inline_queries":false}}

"WebRequest_Test_Script.mq5" exexcution result on 'Experts' Tab of Toolbox:
2020.06.07 11:32:23.084 t0 (EURUSD,H1)  Build=2485 WebRequest=200 GetLastError=0 strData={"ok":true,"result":{"id":996256588,"is_bot":true,"first_name":"Signal1","username":"Signal1bot","can_join_groups":true,"can_read_all_group_messages":false,"supports_inline_queries":false}}

Andrey you helped me find it.

 
Andrey Voytenko:

I ask everyone who has error 1001.

Please run this script and paste here the line from the Experts tab with the result.

An example:

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

Additionally describe your operating system

Windows 7 7601 SP1

This will help to solve this problem.

I am already test your script in two system

First in windows 7 7601 SP1, running error like  your error
Second in windows 10 pro 64 bit build 18363 running well no error


 

@GedThey MaThey

Please run this request on your Windows 7 7601 SP1 in command prompt and paste here your result. If you dont have cURL please install from here https://curl.haxx.se/windows/

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

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:

@GedThey MaThey

Please run this request on your Windows 7 7601 SP1 in command prompt and paste here your result. If you dont have cURL please install from here https://curl.haxx.se/windows/

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

i have result from windows 7 

Files:
 
GedThey MaThey:

i have result from windows 7 

Useful test result. Thanks.

 
Andrey Voytenko:

Useful test result. Thanks.

welcome sir

 
Andrey Voytenko:

I ask everyone who has error 1001.

Please run this script and paste here the line from the Experts tab with the result.

An example:

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

Additionally describe your operating system

Windows 7 7601 SP1

This will help to solve this problem.

additional test, i am test on mt4 in my windows 7 7601 sp1 same error

Files:
 

@Rashid Umarov The result of another test.