java - How does one send chat message from chat bot to clients? -


I have created a bot which can answer when the customer sends messages. I have to send a message to the customer without sending a message to him. I do not want to code in every message. Can anyone recommend a method for this? Thank you.

  XMPPS service xmpps = XMPPServiceFactory.getXMPPService (); Message message = xmpps Similar message (request); ........... msg = new MessageBuilder () .withRecipientJids (jid) .withBody (respMsg) .build (); Xmpps.sendMessage (MSG);   

What the code does the above, it sends a message to the customer after receiving the message. My bots basically tell customers about important announcements, so suppose I have some important Want to ask. I just want to send a message and all my customers should get it. Do I need a JID of my clients? If so, how do I get them? I am new to xmpp please help me

Thank you.

It is not possible to broadcast messages to all jou xmpp contacts at one time You should know if you look deeply into the XMPP code, you will see that status updates will be broadcast to all contacts who are not offline. Perhaps you can use it for your benefit.

Comments