Reply To Telegram message With MQL4 New comment wahaab 2023.04.11 22:23 hello, Is there a way for me to search for a specific message in my telegram channel, when SL or TP hited , reply to it using telegram's 'Reply' fonction? i try this but it didnt work. 20= index msg on telegram manually. Thanks, have a great day!. bool ReplyTelegramMessage(string url,string token,string chat_id,string text) { string headers=""; string requestUrl=""; char postData[]; char resultData[]; string resultHeaders=""; int timeout=1000; requestUrl=StringFormat("%s/bot%s/sendmessage",url,token); string params=StringFormat("chat_id=%s&&reply_to_message_id=%s&text=%s",chat_id,20,text); char data[]; int data_size=StringLen(params); StringToCharArray(params,data,0,data_size); ResetLastError(); int response=WebRequest("POST",requestUrl,NULL,NULL,timeout,data,data_size,resultData,resultHeaders); int error_code=GetLastError(); string error_msg=ErrorDescription(error_code); Print("Error in WebRequest. Error code: ",error_code," Error: ",error_msg); switch(response) { case -1: { int errorCode=GetLastError(); Print("Error in WebRequest. erroe code= ",errorCode); if(errorCode==UrlDefinedError) { PrintFormat("Add The Adrese '%s' in the list of allowed URLs",url); } break; } case 200: //Success Print("The message has been successfully sent"); break; default: { string result=CharArrayToString(resultData); PrintFormat("Unexpected Response '%i', '%s'",response,result); break; } } return(response==200); } telegram.mqh reply to msg Telegram reply message text Telegram BOT reply to messages with quote New comment
hello,
Is there a way for me to search for a specific message in my telegram channel, when SL or TP hited , reply to it using telegram's 'Reply' fonction?
i try this but it didnt work.
20= index msg on telegram manually.
Thanks, have a great day!.