Class LongPoll


  • public class LongPoll
    extends Object
    com.petersamokhin.bots.sdk.Main class for work with VK longpoll server More: link
    • Constructor Detail

      • LongPoll

        public LongPoll​(Client client)
        Simple default constructor that requires only access token
        Parameters:
        client - client with your access token key, more: link
    • Method Detail

      • off

        public void off()
        If you need to set new longpoll server, or restart listening off old before.
      • registerCallback

        public void registerCallback​(String name,
                                     Callback callback)
        Add callback to the map
        Parameters:
        name - Callback name
        callback - Callback
      • registerAbstractCallback

        public void registerAbstractCallback​(String name,
                                             AbstractCallback callback)
        Add callback to the map
        Parameters:
        name - Callback name
        callback - Callback
      • registerChatCallback

        public void registerChatCallback​(String name,
                                         AbstractCallback callback)
        Add callback to the map
        Parameters:
        name - Callback name
        callback - Callback
      • enableTyping

        public void enableTyping​(boolean enable)
        If the client need to start typing after receiving message and until client's message is sent
        Parameters:
        enable - true or false
      • enableLoggingUpdates

        public void enableLoggingUpdates​(boolean enable)