Choice technology stack for local chat

I need a server chat with next futures:

  1. Local installation inside intranet hosting possibility

  2. Server side with possible chat bot ( like echo bot with node.js)

  3. Rich message between bot and user (the possibility of chat between users is not needed).

Under rich message i mean buttons ( button in chat for user quiz and server reaction for choice like telegram: button in chat.jpg), pictures and different files

  1. Pwa client for chat 

So what about technology stack for this development ?
Does it possible with ejubberd + react-native-gifted-chat for example, or something else. Could you advice.