stevenengland / MMM

A free set of messeging modules for the MetaTrader platform
GNU Affero General Public License v3.0
14 stars 3 forks source link

GetUpdates() does not return the whole JSON #22

Closed FredRodrigues closed 4 years ago

FredRodrigues commented 4 years ago

Describe the bug Hi Steven,

First of all, I would like to thank you for providing this repository. I am trying to send a message from telegram to MT5, I am able to receive on MT5 but the problem is that I don't get the whole JSON from the GetUpdates() method or the GetMessageByCorrelationId() one. (same problem)

I am currently using the dll StEn.MMM.Mql.Telegram.dll, although I tried the other one as well

As you can see on the image below, the first JSON is what the method GetUpdates() on MT5 returns and the second JSON is what I get from doing the request by webrowser https://api.telegram.org/botTOKEN/getUpdates

image

The GetMe() method returns the whole JSON, the problem is only on the GetUpdates(), do you know what could be the problem?

Screenshots and part of the code below:

` jsonLib.Clear();

  Sleep(1000);

  string resultOfGetMessageByCorrelationId = TelegramModule::GetMessageByCorrelationId(correlationKey);
   Sleep(1000);

   response = resultOfGetMessageByCorrelationId;
  isSerializable = jsonLib.Deserialize(response);

  Print("Correlation Key: " + jsonLib["correlationKey"].ToStr());
  Print("Content:  " + jsonLib["content"].ToStr());

  string resultOfGetUpdates = TelegramModule::GetUpdates(-1 ,0); //get the most recent
   Sleep(1000);

   Print ("resultOfGetUpdates: " + resultOfGetUpdates);`

image

Desktop (please complete the following information):

stevenengland commented 4 years ago

Hi @FredRodrigues, sorry for the delay. I simply forgot to automatically push notifications to me whenever a new issue is created... Please notice that the debugger will only provide the first 255 characters. The variable itself (resultOfGetUpdates) will have the full content. I just tried it and got 413 characters which is more than in your screenshot. Could you check that please?

stevenengland commented 4 years ago

Close because of missing information. Feel free to reopen this issue anytime.