Package io.github.jtwitch.socket
Class TwitchBot
java.lang.Object
io.github.jtwitch.socket.TwitchBot
Represent a twitch bot before it is connected.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconnect()
connect the bot to the twitch socket.trigger the socket to connect to the SSL connection of twitchwithActionOnMessage(MessageAction messageAction)
add an action triggered by a messagewithScheduleAction(int periodInSecond, ScheduleAction.Action action)
add an action
-
Constructor Details
-
TwitchBot
The only constructor.- Parameters:
botAccount
- the name of the bot account. for instance, if your bot account isnightbot
, the botAccount isnightbot
token
- the connection token the you generate here
-
-
Method Details
-
secureConnection
trigger the socket to connect to the SSL connection of twitch- Returns:
- the
TwitchBot
builder with a secure connection.
-
withActionOnMessage
add an action triggered by a message- Parameters:
messageAction
- action triggered by a message- Returns:
- the
TwitchBot
builder
-
withScheduleAction
add an action- Parameters:
periodInSecond
- time when you trigger an actionaction
- the schedule action- Returns:
- the
TwitchBot
builder
-
connect
connect the bot to the twitch socket.- Returns:
- the
ConnectedTwitchBot
with all de configured action. - Throws:
InterruptedException
- if the socket connection stopURISyntaxException
- if the socket change address
-