telegram.mqh reply to msg - page 4

 
David Michael #:

Dear Sir, do you have clue how to delete a message when we already have its message_id ? thank you in advance

Hi , i don't think the bot api can do that , but i'll look into it .

Also , if the users notice messages are deleted (past signals for instance) the trust will go down . 

 
Lorentzos Roussos #:

Hi , i don't think the bot api can do that , but i'll look into it .

Also , if the users notice messages are deleted (past signals for instance) the trust will go down . 

Hello , Lorentzos Roussos #:

is it possible to get updates from the telegram channel? how we can get the last message data in mql4 ?

i tried lots of things but couldn't find a solution for getting updates from the telegram to my mql4 we can send the data from mql4 to telegram but i am not sure how i can get that data from the telegram channel 
telegram.mqh reply to msg
telegram.mqh reply to msg
  • 2023.08.04
  • www.mql5.com
Hello, I am currently coding an EA with telegram.mqh that send mt4 signals to my telegram...
 
Asad Sheikh #:
Hello , Lorentzos Roussos #:

is it possible to get updates from the telegram channel? how we can get the last message data in mql4 ?

i tried lots of things but couldn't find a solution for getting updates from the telegram to my mql4 we can send the data from mql4 to telegram but i am not sure how i can get that data from the telegram channel 

You mean messages to the bot in a channel ?

 
Lorentzos Roussos #:

You mean messages to the bot in a channel ?

i was able to get messages update from the Bot using this code 
//+------------------------------------------------------------------+
//|   CMyBot                                                         |
//+------------------------------------------------------------------+
class CMyBot: public CCustomBot
  {
public:
   void              ProcessMessages(void)
     {
     
      for(int i=0; i<m_chats.Total(); i++)
        {

         CCustomChat *chat=m_chats.GetNodeAtIndex(i);
         //--- if the message is not processed
         if(!chat.m_new_one.done)
           {
            chat.m_new_one.done=true;
            string text=chat.m_new_one.message_text;
            Print(text);
            //--- start
            if(text=="/start")
               SendMessage(chat.m_id,"Hello, world! I am bot. \xF680");

            //--- help
            if(text=="/help")
               SendMessage(chat.m_id,"My commands list: \n/start-start chatting with me \n/help-get help");
           }
        }
     }

  };

but i am not able to get messages from the telegram channel 

Improperly formatted code edited by moderator.

 
Asad Sheikh #: i was able to get messages update from the Bot using this code but i am not able to get messages from the telegram channel 

Yeah this gets the messages for the chats of a user with the bot .

Do you need the messages sent to the bot within a group ? or just the messages a random channel posts ? 

If the channel is public you can "scrape" it , not all messages thought just the latest but you must find its public id first.

 
@Asad Sheikh #: i was able to get messages update from the Bot using this code but i am not able to get messages from the telegram channel 

Improperly formatted code edited by moderator.

Please always use the CODE button (Alt-S) when inserting code.

Code button in editor

 

Hello,


I tried to add emoji on my message to telegram.


When i use unicode like U+2702 it works using " \x2702"

When i use unicode like this : U+1F64E it does not.

Please, could you tell me wht to do ?

I included <telegram.mqh> as i read it.


Thx.

 
Lorentzos Roussos #:

No it was okay . 

Is there a way to reply to a signal in Telegram channel/group and then some commands take places in mt4?


for example your reply is "close trade" and then that trade in the reply closes.

Reason: