Package io.github.jtwitch.socket
Class ConnectedTwitchBot
java.lang.Object
io.github.jtwitch.socket.ConnectedTwitchBot
Represent a Twitch bos when it is connected.
Before it is connected, you can't join a channel or send a message.
To create a connection you need to use
To create a connection you need to use
TwitchBot.connect()
.-
Constructor Summary
ConstructorsConstructorDescriptionConnectedTwitchBot(ConnectionOption connectionOption, List<MessageAction> messageActions, List<ScheduleAction> scheduleActions)
constructor with all -
Method Summary
Modifier and TypeMethodDescriptionvoid
reply to a message.void
send command to a specific channel.void
delete a message.Join a streamer channel.Leave a streamer channelvoid
Mention a specific user on a specific channel.void
send a message to a specific channel.void
sendRawSocketMessage(String message)
send a raw command to the socket.void
This command sends a private message to another user on Twitch.
-
Constructor Details
-
ConnectedTwitchBot
public ConnectedTwitchBot(ConnectionOption connectionOption, List<MessageAction> messageActions, List<ScheduleAction> scheduleActions) throws InterruptedException, URISyntaxExceptionconstructor with all- Parameters:
connectionOption
- the credentionmessageActions
- all the message actionscheduleActions
- all the schedule action when the bot is on- Throws:
InterruptedException
- if the socket connection stopURISyntaxException
- if the socket change address
-
-
Method Details
-
join
Join a streamer channel.- Parameters:
streamer
- the channel to join- Returns:
- itself
-
leave
Leave a streamer channel- Parameters:
streamer
- the channel to quit- Returns:
- itself
-
send
send a message to a specific channel.- Parameters:
streamer
- the channel to send a messagemessage
- the message to send
-
answer
reply to a message.- Parameters:
messageToAnswer
- the targeted message to answermessage
- the message to send
-
whisper
This command sends a private message to another user on Twitch.- Parameters:
user
- the targeted user to whispermessage
- the message to whisper
-
mention
Mention a specific user on a specific channel.- Parameters:
user
- the user to mentionstreamer
- the channel where to mention itmessage
- the message
-
command
send command to a specific channel. You need to useCommands
repository.- Parameters:
streamer
- the channel where to send the commandcommand
- the command to send. it can be find byCommands
-
delete
delete a message.- Parameters:
message
- the targeted message to delete
-
sendRawSocketMessage
send a raw command to the socket.
Warning : Use this command only if a specific command does not exist in the wrapper.- Parameters:
message
- the raw socket message
-