Discussion of article "How to create bots for Telegram in MQL5" - page 41

 
Andrey Kaunov:

Good evening, colleagues.

Could you please tell me how to add smileys to the text of a message?

Look in the article, there is an answer there.

 
Thank you, there really is. Something I missed ))))
 

Good afternoon everyone!

bot.SendMessage() does not work in the tester. No one has solved this problem? I would be grateful for advice))))

 
AMarkov:

Good afternoon, everyone!

bot.SendMessage() does not work in the tester. No one has solved this problem? I would be grateful for advice))))

WebRequest() is not executed in the tester. Go to wininet.dll

 
Andrey Khatimlianskii:

WebRequest() is not executed in the tester. Go to wininet.dll

I don't know much about this technology, it's just that everything works on 4 in the tester (100%, I've been using it for a long time). I decided to rewrite to 5, and there is silence). I think the same mqh files are used...
 
Andrey Khatimlianskii:

WebRequest() is not executed in the tester. Go to wininet.dll

In real life, everything works, but in the tester it doesn't.

I haven't found where this library is declared in 4 in my system

 
Andrey Voytenko:

ok. But if you are working with a private channel, use the Channel ID, not the Channel Name.

Hey guys! Hello Andrey, I've been using the telegram signal EA for a couple of months now, but on a public channel. Now I'm trying to put in a private channel and reading about it here seems the setup is different:

You mean:

- Instead o putting the channel name, I put the Channel ID ( I  got the channel ID fowarding a channel message to the @getidsbot on telegram, ifanyones wondering)


Like this?

//--- input parameters
input string InpChannelName="1234567898763";//Channel Name (here i changed the name of the public channel to the Channel ID (because the public channel is now private) , is this correct?)
input string InpToken="9999995551:AAGKxSgx45asdcvft9DSr0Yp7HB98klU1r0";//Token


In advance: Thank you, learned a ton by reading this thread here.

 
Joao Lucas Silva Penido:

Hey guys! Hello Andrey, I've been using the telegram signal EA for a couple of months now, but on a public channel. Now I'm trying to put in a private channel and reading about it here seems the setup is different:

You mean:

- Instead o putting the channel name, I put the Channel ID ( I  got the channel ID fowarding a channel message to the @getidsbot on telegram, ifanyones wondering)


Like this?


In advance: Thank you, learned a ton by reading this thread here.

Telegram.mqh on line 980 calls for:

int               SendMessage(const long    _chat_id,
                                 const string  _text,
                                 const string  _reply_markup=NULL,
                                 const bool    _as_HTML=false,
                                 const bool    _silently=false)

and in line 1006 calls for:

int               SendMessage(const string _channel_name,
                                 const string _text,
                                 const bool   _as_HTML=false,
                                 const bool   _silently=false)

for sending a message to a private channel i have to pourposely define chat_id as a long like this:

input long InpChatId= -(use h t t p s ://t.me/username_to_id_bot to obtain your private chat id); // Chat ID Private

and use it to cast to telegram

int res=bot.SendMessage(InpChatId,msg);
            if(res!=0)
               Print("Error: ",GetErrorDescription(res));

otherwise it will not work, if someone knows a code to identify when we use an string @publicChannelName or a long -privateChannelName  to cast acordinglly please post it here!

 

hi 

I have done adding the address "https://api.telegram.org" in EA tools, but I am still getting the error of url does not allowed for webrequest, why is that please?

I am just trying to use the example EA, which is the TelegramAlertMT4 from https://github.com/sholafalana/MT5-MT4-Telegram-API-Bot

I have copied the 4 files from include to include, and paste the TelegramAlertMT4.mq4 into indicator folder, compiled with no error.

If I put it under EA folder and run it, I never get the smily face, even though i have enabled auto trading.

Many thanks

 
Good afternoon. No access to telegram api url, error 1001. The question has already been raised here, who had such a problem and who was able to solve it, please share it with me