Class Chzzk
java.lang.Object
io.github.bbobbogi.stream4j.chzzk.Chzzk
Chzzk (CHZZK) API client class.
- Since:
- 1.0.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getChannel(String channelId) GetChzzkChannelInfoby the channel id.getChannelChatRules(String channelId) Get channel'sChzzkChannelRulesby the channel id.getChannelEmotePackData(String channelId) Gets emote pack data for the channel.getFollowingStatus(String channelId) Get following status about channel.okhttp3.OkHttpClientReturns the HTTP client.@NotNull ChzzkLiveDetailgetLiveDetail(@NotNull String channelId) GetChzzkLiveDetailby the channel id.@NotNull ChzzkLiveInfogetLiveStatus(@NotNull String channelId) GetChzzkLiveInfoby the channel id.booleanGet thisChzzklogged in.
-
Field Details
-
API_URL
CHZZK API URL -
GAME_API_URL
NAVER game API URL. -
isDebug
public boolean isDebugWhether debug mode is enabled.
-
-
Method Details
-
isLoggedIn
public boolean isLoggedIn()Get thisChzzklogged in.- Returns:
trueif logged in, otherwisefalse
-
chat
- Parameters:
channelId- channel ID- Returns:
- a
ChzzkChatBuilderinstance
-
getHttpClient
public okhttp3.OkHttpClient getHttpClient()Returns the HTTP client.- Returns:
- an
OkHttpClientinstance
-
close
public void close() -
getChannel
GetChzzkChannelInfoby the channel id.- Parameters:
channelId- ID ofChzzkChannelInfothat to get.- Returns:
ChzzkChannelInfoto get- Throws:
IOException- if the request to API failedChannelNotExistsException- if the channel doesn't exists
-
getLiveStatus
@NotNull public @NotNull ChzzkLiveInfo getLiveStatus(@NotNull @NotNull String channelId) throws IOException GetChzzkLiveInfoby the channel id.- Parameters:
channelId- ID ofChzzkChannelInfo- Returns:
ChzzkLiveInfoof the channel- Throws:
IOException- if the request to API failed
-
getLiveDetail
@NotNull public @NotNull ChzzkLiveDetail getLiveDetail(@NotNull @NotNull String channelId) throws IOException GetChzzkLiveDetailby the channel id.- Parameters:
channelId- ID ofChzzkChannelInfo- Returns:
ChzzkLiveDetailof the channel- Throws:
IOException- if the request to API failed
-
getChannelChatRules
public ChzzkChannelRules getChannelChatRules(String channelId) throws IOException, NotExistsException Get channel'sChzzkChannelRulesby the channel id.- Parameters:
channelId- ID ofChzzkChannelInfo- Returns:
ChzzkChannelRulesof the channel- Throws:
IOException- if the request to API failedNotExistsException- if the channel doesn't exists or the rules of the channel doesn't available
-
getChannelEmotePackData
Gets emote pack data for the channel.- Parameters:
channelId- channel ID- Returns:
ChzzkChannelEmotePackDataemote pack data- Throws:
IOException- if the API request fails
-
getFollowingStatus
public ChzzkChannelFollowingData getFollowingStatus(String channelId) throws IOException, NotLoggedInException, ChannelNotExistsException Get following status about channel.- Parameters:
channelId- ID ofChzzkChannelInfoto get following status- Returns:
- user's
ChzzkChannelFollowingDataof the channel - Throws:
IOException- if the request to API failedNotLoggedInException- if thisChzzkdidn't log inChannelNotExistsException- if the channel doesn't exists
-
getRecommendationChannels
- Returns:
- recommendation channels -
ChzzkRecommendationChannels - Throws:
IOException- if the request to API failed
-
getLoggedUser
- Returns:
ChzzkUserthat current logged in- Throws:
IOException- if the request to API failedNotLoggedInException- if thisChzzkdidn't log in
-