Send multiple lines of text to Telegram via WebRequest

AlvinSanusi
11

Dear Developers,

I created an EA in MQL4 where I send 3 lines of text to Telegram where each line is ended with <br> as follows

message = StringFormat("%s v.%s<br>",EXPERT_NAME,EXPERT_VERSION) +   

                  StringFormat("%s:SELL: %.2f lot<br>", Symbol(), LOT_SIZE) +

                  StringFormat("Sell Price: %.8f",Bid);

string url = mBaseUrl+"/bot"+mToken+"/sendMessage?chat_id="+mChatID+"&text="+message;

returnval=WebRequest("GET",url,mCookie,NULL,timeout,mPost,0,mResult,mHeaders);

But somehow, the message are shown in Telegram as 1 single line, concatenating all the 3 lines.

Can anyone provide some help for me on how to separate each lines so it is shown neatly in Telegram message?

Thank you.

Alvin

Mohammad Hossein Sadeghi
3297

You are missing parse_mode=HTML according to sendMessage syntax in Telegram Bot API, if you want to use HTML tags, but keep in mind, supported tags are little and <br> is not among them.

Simply use "\r\n" instead.

Alfoel Ramirez
9
Alfoel Ramirez  
Mohammad Hossein Sadeghi #:

You are missing parse_mode=HTML according to sendMessage syntax in Telegram Bot API, if you want to use HTML tags, but keep in mind, supported tags are little and <br> is not among them.

Simply use "\r\n" instead.

I don't know what is the syntax that I have to use, can you help me?
Philippe Pauleau
353
Philippe Pauleau  

Insert %250a to make a line break. (ie replace <br> with %250a)

William Roeder
28234
William Roeder  
Alfoel Ramirez #: I don't know what is the syntax that I have to use, can you help me?

Syntax is irrelevant. Your DLL is not loaded, per your picture.

Philippe Pauleau
353
Philippe Pauleau  
William Roeder #:

Syntax is irrelevant. Your DLL is not loaded, per your picture.


From the error message it seems that the DLL is 64 bits and MT5 is 32 bits.