Class FollowersCache

java.lang.Object
tv.phantombot.cache.FollowersCache

public final class FollowersCache extends Object
Periodically checks the API for new followers
Author:
gmt2001
  • Method Details

    • instance

      public static FollowersCache instance()
    • addFollow

      public void addFollow(String loginName, ZonedDateTime followedAt)
      Adds a follow to the cache, and sends notifications if necessary
      Parameters:
      loginName - The login name of the follower
      followedAt - The ISO8601 timestamp when the follow ocurred
    • addFollow

      public void addFollow(String loginName, ZonedDateTime followedAt, boolean silent)
      Adds a follow to the cache, and sends notifications if necessary
      Parameters:
      loginName - The login name of the follower
      followedAt - The ISO8601 timestamp when the follow ocurred
      silent - If true, don't announce the follow
    • addFollow

      public void addFollow(String loginName, String followedAt)
      Adds a follow to the cache, and sends notifications if necessary
      Parameters:
      loginName - The login name of the follower
      followedAt - The ISO8601 timestamp when the follow ocurred
    • addFollow

      public void addFollow(String loginName, String followedAt, boolean silent)
      Adds a follow to the cache, and sends notifications if necessary
      Parameters:
      loginName - The login name of the follower
      followedAt - The ISO8601 timestamp when the follow ocurred
      silent - If true, don't announce the follow
    • total

      public int total()
      Returns the total number of followers, according to Twitch API
      Returns:
    • follows

      public boolean follows(String loginName)
      Indicates if the specified user currently follows the channel
      Parameters:
      loginName - The login name of the user
      Returns:
    • followed

      public boolean followed(String loginName)
      Indicates if the specified user has followed at some point in the past, within the limits of the bots records
      Parameters:
      loginName - The login name of the user
      Returns:
    • followedDateString

      public String followedDateString(String loginName)
      Indicates the earliest timestamp when the bot is aware of the specified user following as a string
      Parameters:
      loginName - The login name of the user
      Returns:
    • followedDate

      public ZonedDateTime followedDate(String loginName)
      Indicates the earliest timestamp when the bot is aware of the specified user following
      Parameters:
      loginName - The login name of the user
      Returns:
    • kill

      public void kill()