Class MessengerConnector

  • All Implemented Interfaces:
    ai.tock.bot.connector.Connector

    
    public final class MessengerConnector
    extends ConnectorBase
                        

    Contains built-in checks to ensure that two MessageRequest for the same recipient are sent sequentially.

    • Constructor Detail

    • Method Detail

      • sendOptInEvent

        @Deprecated(message = "deprecated - use BotRepository#notify") final Unit sendOptInEvent(Event event)

        Send action after an optin request, using the recipient.user_ref property. See https://developers.facebook.com/docs/messenger-platform/plugin-reference/checkbox-plugin#implementation for more details.

      • sendCustomEvent

         final Unit sendCustomEvent(CustomEventRequest customEventRequest)

        Send a custom event to messenger

        Parameters:
        customEventRequest - an object containing a list of custom events
      • getThreadOwner

         final String getThreadOwner(PlayerId userId)

        Returns the current thread owner (handover protocol).

        Parameters:
        userId - the user id you would like to known
      • send

         Unit send(Event event, ConnectorCallback callback, Long delayInMs)

        Send the event to messenger asynchronously. Contains checks to ensure that two Action for the same recipient are sent sequentially.

      • loadProfile

         UserPreferences loadProfile(ConnectorCallback callback, PlayerId userId)
      • refreshProfile

         UserPreferences refreshProfile(ConnectorCallback callback, PlayerId userId)
      • notify

         Unit notify(ConnectorController controller, PlayerId recipientId, IntentAware intent, StoryStep<out StoryHandlerDefinition> step, Map<String, String> parameters, ActionNotificationType notificationType, Function1<Throwable, Unit> errorListener)