Package com.github.twitch4j.chat
Schnittstelle ITwitchChat
- Alle Superschnittstellen:
AutoCloseable
- Alle bekannten Implementierungsklassen:
TwitchChat,TwitchChatConnectionPool
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungdefault booleanVeraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#banUserdefault booleanVeraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#deleteChatMessagesvoidclose()default booleanVeraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#deleteChatMessagesReturns a set of all currently joined channels (without # prefix)longdefault booleanisChannelJoined(String channelName) Check if Chat is currently in a channelvoidjoinChannel(String channelName) Joins a channelbooleanleaveChannel(String channelName) Parts from a channeldefault booleansendActionMessage(String channel, String message) Sends an action message (/me) in a joined channel.default booleansendAnnouncement(String channel, String message) Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#sendChatAnnouncementdefault booleansendMessage(String channel, String message) Sends a message in a joined channel.default booleansendMessage(String channel, String message, String nonce, String replyMsgId) Sends a message to the channel while including an optional nonce and/or reply parent.booleanSends a message to the channel while including the specified message tags.default booleansetEmoteOnly(String channel, boolean enable) Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#updateChatSettingsdefault booleansetFollowersOnly(String channel, Duration time) Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#updateChatSettingsdefault booleansetSlowMode(String channel, int seconds) Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#updateChatSettingsdefault booleansetSubscribersOnly(String channel, boolean enable) Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#updateChatSettingsdefault booleansetUniqueChat(String channel, boolean enable) Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#updateChatSettingsdefault booleanVeraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#banUserdefault booleanVeraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#unbanUser
-
Methodendetails
-
getEventManager
EventManager getEventManager() -
joinChannel
Joins a channel- Parameter:
channelName- The target channel name.
-
leaveChannel
Parts from a channel- Parameter:
channelName- The target channel name.- Gibt zurück:
- whether the channel was previously joined
-
sendMessage
Sends a message in a joined channel.- Parameter:
channel- The target channel name.message- The message to be sent.- Gibt zurück:
- whether the message was added to the queue
-
sendMessage
default boolean sendMessage(String channel, String message, @Unofficial String nonce, String replyMsgId) Sends a message to the channel while including an optional nonce and/or reply parent.- Parameter:
channel- the name of the channel to send the message to.message- the message to be sent.nonce- the cryptographic nonce (optional).replyMsgId- the msgId of the parent message being replied to (optional).- Gibt zurück:
- whether the message was added to the queue
-
sendMessage
Sends a message to the channel while including the specified message tags.- Parameter:
channel- the name of the channel to send the message to.message- the message to be sent.tags- the message tags.- Gibt zurück:
- whether the message was added to the queue
-
getChannels
Returns a set of all currently joined channels (without # prefix)- Gibt zurück:
- a set of channel names
-
close
void close()- Angegeben von:
closein SchnittstelleAutoCloseable
-
getLatency
long getLatency()- Gibt zurück:
- the most recently measured round-trip latency for the socket(s) in milliseconds, or -1 if unknown
-
getChannelIdToChannelName
- Gibt zurück:
- cached mappings of channel ids to names
-
getChannelNameToChannelId
- Gibt zurück:
- cached mappings of channel names to ids
-
isChannelJoined
Check if Chat is currently in a channel- Parameter:
channelName- channel to check (without # prefix)- Gibt zurück:
- boolean
-
sendActionMessage
Sends an action message (/me) in a joined channel.- Parameter:
channel- The target channel name.message- The message to be sent.- Gibt zurück:
- whether the message was added to the queue
-
setSlowMode
@Deprecated @ScheduledForRemoval(inVersion="2.0.0") default boolean setSlowMode(String channel, int seconds) Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#updateChatSettingsConfigures the slow mode setting for a channel.Non-positive values would disable slow mode. Positive values must not be greater than 1800.
- Parameter:
channel- The target channel name.seconds- The slow mode seconds.- Gibt zurück:
- whether the command was added to the queue
-
setFollowersOnly
@Deprecated @ScheduledForRemoval(inVersion="2.0.0") default boolean setFollowersOnly(String channel, Duration time) Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#updateChatSettingsConfigures followers only mode in a channel.Passing null (or a negative duration) for time disables followers only. The amount of time must not exceed 3 months.
- Parameter:
channel- The target channel name.time- The amount of time users must be followed.- Gibt zurück:
- whether the command was added to the queue
-
setSubscribersOnly
@Deprecated @ScheduledForRemoval(inVersion="2.0.0") default boolean setSubscribersOnly(String channel, boolean enable) Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#updateChatSettingsConfigures subscribers only mode in a channel.- Parameter:
channel- The target channel name.enable- Whether the setting should be enabled or disabled.- Gibt zurück:
- whether the command was added to the queue
-
setUniqueChat
@Deprecated @ScheduledForRemoval(inVersion="2.0.0") default boolean setUniqueChat(String channel, boolean enable) Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#updateChatSettingsConfigures unique chat mode (r9k) in a channel.- Parameter:
channel- The target channel name.enable- Whether the setting should be enabled or disabled.- Gibt zurück:
- whether the command was added to the queue
-
setEmoteOnly
@Deprecated @ScheduledForRemoval(inVersion="2.0.0") default boolean setEmoteOnly(String channel, boolean enable) Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#updateChatSettingsConfigures emote only mode in a channel.- Parameter:
channel- The target channel name.enable- Whether the setting should be enabled or disabled.- Gibt zurück:
- whether the command was added to the queue
-
clearChat
Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#deleteChatMessagesClears the history for first-party chat clients.- Parameter:
channel- The target channel name.- Gibt zurück:
- whether the command was added to the queue
-
delete
@Deprecated @ScheduledForRemoval(inVersion="2.0.0") default boolean delete(String channel, String targetMsgId) Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#deleteChatMessagesDeletes a message.- Parameter:
channel- the name of the channel to delete the message from.targetMsgId- the unique id of the message to be deleted.- Gibt zurück:
- whether the command was added to the queue
- Siehe auch:
-
timeout
@Deprecated @ScheduledForRemoval(inVersion="2.0.0") default boolean timeout(String channel, String user, Duration duration, String reason) Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#banUserTimeout a user- Parameter:
channel- channeluser- usernameduration- durationreason- reason- Gibt zurück:
- whether the command was added to the queue
-
ban
@Deprecated @ScheduledForRemoval(inVersion="2.0.0") default boolean ban(String channel, String user, String reason) Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#banUserBan a user- Parameter:
channel- channeluser- usernamereason- reason- Gibt zurück:
- whether the command was added to the queue
-
unban
@Deprecated @ScheduledForRemoval(inVersion="2.0.0") default boolean unban(String channel, String user) Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#unbanUserUnban a user- Parameter:
channel- channeluser- username- Gibt zurück:
- whether the command was added to the queue
-
sendAnnouncement
@Unofficial @Deprecated @ScheduledForRemoval(inVersion="2.0.0") default boolean sendAnnouncement(String channel, String message) Veraltet.Twitch will decommission this method on February 18, 2023; migrate to TwitchHelix#sendChatAnnouncementSend a mod announcement (accented message)- Parameter:
channel- the name of the channel to send the announcement in.message- the message to be announced.- Gibt zurück:
- whether the command was added to the queue
- Siehe auch:
-