Skip to content

Commit

Permalink
Update TelegramAlertMT4.mq4
Browse files Browse the repository at this point in the history
  • Loading branch information
sholafalana committed Dec 29, 2020
1 parent 738c6af commit a090de7
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions Experts/TelegramAlertMT4.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,29 @@ int StartTelegramServer()
{
bot.Token(InpToken);

if(!checked)
{
if(StringLen(InpChannelName)==0)
{
Print("Error: Channel name is empty");
Sleep(10000);
return (0);
}

int result=bot.GetMe();
if(result==0)
{
Print("Bot name: ",bot.Name());
checked=true;
}
else
{
Print("Error: ",GetErrorDescription(result));
Sleep(10000);
return(0);
}
}

GetCurrentOrdersOnStart();

int changed = 0;
Expand All @@ -160,28 +183,7 @@ int StartTelegramServer()
}


if(!checked)
{
if(StringLen(InpChannelName)==0)
{
Print("Error: Channel name is empty");
Sleep(10000);
return (0);
}

int result=bot.GetMe();
if(result==0)
{
Print("Bot name: ",bot.Name());
checked=true;
}
else
{
Print("Error: ",GetErrorDescription(result));
Sleep(10000);
return(0);
}
}
return(0);
}

Expand Down

0 comments on commit a090de7

Please sign in to comment.