문제

Is it possible to do some action when a chat request is sent by the user to the bot? I know it gets authorized to communicate with the bot, but I want to store the JID of the user as soon as he adds the bot. Is something like this possible?

도움이 되었습니까?

해결책

Yes, it is possible.

The XMPP Service in GAE also allows you to enable the xmpp_subscribe inbound service. By enabling that in your appengine-web.xml file, you will be able to get the following notifications at the endpoints given below:

  • POSTs to /_ah/xmpp/subscription/subscribe/ signal that the user wishes to subscribe to the application's presence.
  • POSTs to /_ah/xmpp/subscription/subscribed/ signal that the user has allowed the application to receive its presence.
  • POSTs to /_ah/xmpp/subscription/unsubscribe/ signal that the user is unsubscribing from the application's presence.
  • POSTs to /_ah/xmpp/subscription/unsubscribed/ signal that the user has denied the application's subscription request, or cancelled a previously granted subscription.

I have taken the above points from the official documentation. Please refer to the https://developers.google.com/appengine/docs/java/xmpp/overview#Handling_Subscriptions for more details.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top