'MESSAGESENT'will be delivered to your bot through the datafeed:
initiator, as well as the contents of the message itself inside of the payload object. Additionally, you can find the
streamIDcorresponding to the message and also information regarding
DatafeedEventServiceclass that handles all of the logic for creating/reading datafeeds via the API, has best practices for maintaining datafeeds, and also provides event handling architecture that makes it easy to orchestrate complex workflows and introduce custom business logic to your bot.
EventHandlerclasses, passing in a given event type as the type parameter for that class.
DatafeedEventServicecreates/reads from the datafeed API, it categorizes each event based on its event type seen above, and dispatches the event downstream to a generic event handler class. For example, If a user sends a message to bot inside a chatroom, the event will be read by the datafeed, and dispatched downstream to the
EventHandlerclass that that takes
MessageEventin as a type parameter. Further the
handle()method belonging to your
EventHandlerclass will be called each type that event type is read by the datafeed.
onMessageSent()is where you implement your own business logic such as accessing a database, connecting to an external API, or reply back to your user by leveraging the Symphony API/BDK 2.0 methods: