Package com.gmt2001

Class TwitchAPIv5

java.lang.Object
com.gmt2001.TwitchAPIv5

@Deprecated(since="3.6.4.1", forRemoval=true) public class TwitchAPIv5 extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Please use Helix instead. In scripts, use $.helix instead of $.twitch
Stubs to Helix for backwards compatibility
Author:
gmt2001, illusionaryone
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    FixFollowedTable(String channel, DataStore dataStore, boolean force)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Wrapper to perform the followed table updated.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks to see if the bot account is verified by Twitch.
    GetChannel(String channel)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets a channel object
    GetChannel2(String channel, String[] updates)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns when a Twitch account was created.
    GetChannelFollows(String channel, int limit, int offset, boolean ascending)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets an object listing the users following a channel
    GetChannelFollows(String channel, int limit, String from)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets an object listing the users following a channel
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the channel Id
    GetChannelSubscriptions(String channel, int limit, int offset, boolean ascending)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets an object listing the users subscribing to a channel
    GetChannelSubscriptions(String channel, int limit, int offset, boolean ascending, String oauth)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    GetChannelSubscriptions(String channel, int limit, String from)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets an object listing the users subscribing to a channel
    getChannelTeams(String channelName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Method that gets the teams that the channel is in.
    GetChannelVODs(String channel, String type)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the list of VODs from Twitch
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets a list of users in the channel
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the list of cheer emotes from Twitch
    Deprecated, for removal: This API element is subject to removal in a future version.
    Builds a RegExp String to match cheer emotes from Twitch
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the clips from today for a channel.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the communities object array.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the full list of emotes from Twitch
    GetStream(String channel)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets a stream object
    GetStreams(String channels)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets a streams object array.
    getTeam(String teamName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Method that gets a Twitch team.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets a user object by user name
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets a user object by ID
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks if a user is following a channel
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a username when given an Oauth.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    RunCommercial(String channel, int length)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Runs a commercial.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    SetClientID(String clientid)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Tests the Twitch API to ensure that authentication is good.
    UpdateChannel(String channel, String status, String game)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Updates the status and game of a channel
    UpdateChannel(String channel, String status, String game, int delay)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Updates the status and game of a channel
    UpdateChannel(String channel, String oauth, String status, String game)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    UpdateChannel(String channel, String oauth, String status, String game, int delay)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    UpdateCommunities(String channel, String[] communities)
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • instance

      public static TwitchAPIv5 instance()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • SetClientID

      public void SetClientID(String clientid)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • SetOAuth

      public void SetOAuth(String oauth)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • HasOAuth

      public boolean HasOAuth()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • GetChannel

      public JSONObject GetChannel(String channel) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets a channel object
      Parameters:
      channel -
      Returns:
      Throws:
      JSONException
    • GetChannel2

      public JSONObject GetChannel2(String channel, String[] updates) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      JSONException
    • UpdateChannel

      public JSONObject UpdateChannel(String channel, String status, String game) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Updates the status and game of a channel
      Parameters:
      channel -
      status -
      game -
      Returns:
      Throws:
      JSONException
    • UpdateChannel

      public JSONObject UpdateChannel(String channel, String oauth, String status, String game) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      JSONException
    • UpdateChannel

      public JSONObject UpdateChannel(String channel, String oauth, String status, String game, int delay) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      JSONException
    • UpdateChannel

      public JSONObject UpdateChannel(String channel, String status, String game, int delay) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Updates the status and game of a channel
      Parameters:
      channel -
      status -
      game -
      delay - -1 to not update
      Returns:
      Throws:
      JSONException
    • UpdateCommunities

      public JSONObject UpdateCommunities(String channel, String[] communities) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      JSONException
    • SearchGame

      public JSONObject SearchGame(String game) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      JSONException
    • GetCommunityID

      public JSONObject GetCommunityID(String name) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      JSONException
    • GetChannelFollows

      public JSONObject GetChannelFollows(String channel, int limit, int offset, boolean ascending) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets an object listing the users following a channel
      Parameters:
      channel -
      limit - between 1 and 100
      offset -
      ascending -
      Returns:
      Throws:
      JSONException
    • GetChannelFollows

      public JSONObject GetChannelFollows(String channel, int limit, String from) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets an object listing the users following a channel
      Parameters:
      channel -
      limit - between 1 and 100
      from -
      Returns:
      Throws:
      JSONException
    • GetChannelSubscriptions

      public JSONObject GetChannelSubscriptions(String channel, int limit, int offset, boolean ascending) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets an object listing the users subscribing to a channel
      Parameters:
      channel -
      limit - between 1 and 100
      offset -
      ascending -
      Returns:
      Throws:
      JSONException
    • GetChannelSubscriptions

      public JSONObject GetChannelSubscriptions(String channel, int limit, String from) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets an object listing the users subscribing to a channel
      Parameters:
      channel -
      limit - between 1 and 100
      from -
      Returns:
      Throws:
      JSONException
    • GetChannelSubscriptions

      public JSONObject GetChannelSubscriptions(String channel, int limit, int offset, boolean ascending, String oauth) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      JSONException
    • GetStream

      public JSONObject GetStream(String channel) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets a stream object
      Parameters:
      channel -
      Returns:
      Throws:
      JSONException
    • GetStreams

      public JSONObject GetStreams(String channels) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets a streams object array. Each channel id should be separated with a comma.
      Parameters:
      channels -
      Returns:
      Throws:
      JSONException
    • GetCommunities

      public JSONObject GetCommunities(String channel) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the communities object array.
      Parameters:
      channel -
      Returns:
      Throws:
      JSONException
    • GetUser

      public JSONObject GetUser(String user) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets a user object by user name
      Parameters:
      user -
      Returns:
      Throws:
      JSONException
    • GetUserByID

      public JSONObject GetUserByID(String userID) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets a user object by ID
      Parameters:
      userID -
      Returns:
      Throws:
      JSONException
    • RunCommercial

      public JSONObject RunCommercial(String channel, int length) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Runs a commercial. Will fail if channel is not partnered, a commercial has been run in the last 8 minutes, or stream is offline
      Parameters:
      channel -
      length - (30, 60, 90, 120, 150, 180)
      Returns:
      jsonObj.optInt("_http") == 422 if length is invalid or the channel is currently ineligible to run a commercial due to restrictions listed in the method description
      Throws:
      JSONException
    • GetChatUsers

      public JSONObject GetChatUsers(String channel)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets a list of users in the channel
      Parameters:
      channel -
      Returns:
    • GetUserFollowsChannel

      public JSONObject GetUserFollowsChannel(String user, String channel) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks if a user is following a channel
      Parameters:
      user -
      channel -
      Returns:
      Throws:
      JSONException
    • GetEmotes

      public JSONObject GetEmotes() throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the full list of emotes from Twitch
      Returns:
      Throws:
      JSONException
    • GetCheerEmotes

      public JSONObject GetCheerEmotes() throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the list of cheer emotes from Twitch
      Returns:
      Throws:
      JSONException
    • GetCheerEmotesRegex

      public String GetCheerEmotesRegex() throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Builds a RegExp String to match cheer emotes from Twitch
      Returns:
      Throws:
      JSONException
    • GetChannelVODs

      public String GetChannelVODs(String channel, String type) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the list of VODs from Twitch
      Parameters:
      channel - The channel requesting data for
      type - The type of data: current, highlights, archives
      Returns:
      String List of Twitch VOD URLs (as a JSON String) or empty String in failure.
      Throws:
      JSONException
    • getChannelCreatedDate

      public String getChannelCreatedDate(String channel) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns when a Twitch account was created.
      Parameters:
      channel -
      Returns:
      String date-time representation (2015-05-09T00:08:04Z)
      Throws:
      JSONException
    • getChannelTeams

      public JSONObject getChannelTeams(String channelName) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Method that gets the teams that the channel is in.
      Parameters:
      channelName -
      Returns:
      Throws:
      JSONException
    • getTeam

      public JSONObject getTeam(String teamName) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Method that gets a Twitch team.
      Parameters:
      teamName -
      Returns:
      Throws:
      JSONException
    • getBotVerified

      public boolean getBotVerified(String channel) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks to see if the bot account is verified by Twitch.
      Parameters:
      channel -
      Returns:
      boolean true if verified
      Throws:
      JSONException
    • getClipsToday

      public JSONObject getClipsToday(String channel) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the clips from today for a channel.
      Parameters:
      channel -
      Returns:
      JSONObject clips object.
      Throws:
      JSONException
    • FixFollowedTable

      public void FixFollowedTable(String channel, DataStore dataStore, boolean force) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Wrapper to perform the followed table updated. In order to ensure that PhantomBot does not get stuck trying to perform this work, a thread is spawned to perform the work.
      Parameters:
      channel - Name of the channel to lookup data for
      dataStore - Copy of database object
      force - Force the run even if the number of followers is too high
      Throws:
      JSONException
    • TestAPI

      public boolean TestAPI() throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tests the Twitch API to ensure that authentication is good.
      Returns:
      Throws:
      JSONException
    • GetUserFromOauth

      public String GetUserFromOauth(String userOauth) throws JSONException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns a username when given an Oauth.
      Parameters:
      userOauth - Oauth to check with.
      Returns:
      String The name of the user or null to indicate that there was an error.
      Throws:
      JSONException
    • getChannelId

      public int getChannelId(String channel)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the channel Id
      Parameters:
      channel - channel name
      Returns:
      int the channel id.