24 lines
763 B
MQL5
24 lines
763 B
MQL5
#include <TelegramApi/TelegramApi.mq5>
|
|
|
|
#property copyright "Copyright 2018, MetaQuotes Software Corp."
|
|
#property link "https://www.mql5.com"
|
|
#property version "1.00"
|
|
|
|
/**
|
|
* http://t.me/Mql5TestChannel
|
|
**/
|
|
void OnStart()
|
|
{
|
|
/**
|
|
token should be url encoded twice
|
|
|
|
This token for test bot. Please use new bot for your project.
|
|
**/
|
|
TelegramApi* telegramApi = new TelegramApi("578949300%253AAAFZAQjX7LIyo1yp-Rr8whX78jnG1XFe4CI");
|
|
TelegramResponse* response = telegramApi.sendMessage("@Mql5TestChannel", "Test");
|
|
Alert("Error: " + response.getLastError());
|
|
Alert("Headers: " + response.getHeaders());
|
|
char result[];
|
|
response.getResult(result);
|
|
Alert("Result: " + CharArrayToString(result));
|
|
}
|