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

 
Roboboy18 #:

Found how to do it, anyone interested ask )

Asking))))) There is no such thing in the article.

 
Valeriy Yastremskiy #:

Asking))))) There is no such thing in the article.

Because the TG has changed a bit relative to the date the article was published.... As I understand it, there are now 4 basic entities in TG:

  1. Chat;
  2. Channel;
  3. User;
  4. Bot.

Messages are sent by SendMessage() function:

int SendMessage(const long chat_id,
                const string text,
                const string reply_markup=NULL)


For each entity we need to find out its id. This can be done using IDBot (@username_to_id_bot).




Создание бота для Telegram на языке MQL5
Создание бота для Telegram на языке MQL5
  • www.mql5.com
Эта статья — пошаговое руководство по созданию бота для Telegram на языке MQL5. Данный материал будет интересен тем, кто хочет связать торгового робота со своим мобильным устройством. В статье приведены примеры ботов, выполняющие рассылку торговых сигналов, поиск информации на сайте, присылающие информацию о состоянии торгового счета, котировки и скриншоты графиков на ваш смартфон.
 
Denis Kirichenko #:

Because TG has changed a bit relative to the date the article was published.... as I understand it, there are now four basic entities in TG:

  1. Chat;
  2. Channel;
  3. User;
  4. Bot.

Messages are sent by SendMessage() function:


For each entity we need to find out its id. You can do this with an IDBot (@username_to_id_bot).




I don't understand how to do it? It's telling me my username id and the menu bar is a prompt to send. I'll have to read it. ) thanks)
 
Valeriy Yastremskiy #:
I don't understand how to do it. I'm getting my user id and the menu bar is a prompt to send. I'll have to read it. ) thanks)

Yes, it works, but only in chats for some reason it sees groups, although it displays them differently, in chats the number of participants indicates. But in groups it does not. And it doesn't pass the group to the chat, but only to the group tab.

 
How do I make a line break in a message I send to Telegram?
"\n" - it doesn't work.
 
Maksym Mudrakov #:
how do you do a line break on a message that's sent to Telegram?
"\n" - it doesn't work.

"%0A"

 
Maksym Mudrakov #:
How do I make a line break in a message that's sent to Telegram?
"\n" - it doesn't work.

Any text there is HTML. The tags from it work. Colours, formatting...

 
Edgar Akhmadeev #:

Any text there is HTML. The tags from it work. Colours, formatting...

paragraphs, headings))))

 
Vitaly Muzichenko #:
%0A

It's not working for me.

 
Edgar Akhmadeev #:

Any text there is HTML. The tags from it work. Colours, formatting...

I tried writing "<br/>" in the text of the message and also replaced angle brackets and got"&lt;br/&gt;", but it doesn't work