We’ve created a chatbot called Pokeitbot that you can add to your Twitch channel to help answer questions about your current session of poker. The full list of commands can be found in the Bot Commands reference article.
If you already use a chatbot on your stream (e.g. Nightbot), you can use the Pokeit API we’ve set up to access this same information without having to install a second bot.
Linking your Twitch account
In order to authorize Pokeitbot to post in your Twitch channel, you need to connect your Twitch account to Pokeit. You can do this in the Account page by navigating to the Live Streaming section and clicking on the purple button that says Connect your Twitch account.
Pokeitbot options
Once you link your Twitch account to Pokeit, you’ll need to consider how Pokeitbot should work in your stream:
- Automatic posting of hands and tournaments: Pokeit can automatically post the results of completed hands and tournaments to chat. A link to a replayable version is included for hands. This option is enabled by default but can be turned off if you don’t want to include it
- Twitch lag: There is usually a 10-30 second upload lag for Twitch depending on your connection. You’ll need to adjust this value in order to ensure that the data available in chat is synchronized with what’s being broadcast on stream. Adjustments can be made here or in Twitch chat with the commands
!lag +/-{seconds}
- Enabled commands: There are 20 different commands available for people to use. You can disable any of these commands if you don’t want to share that information. Pokeitbot only has access to the current live session and can’t access your entire database
Also, if you ever want to temporarily disable Pokeitbot, click on the switch that says Activate Pokeitbot on your twitch channel when streaming with Pokeit to turn it off.
Using the Pokeit API with Nightbot
To start, you’ll need to turn on the switch next to Enable the Pokeit API in the Live Streaming section of the the Account page. Once that’s done, you can start manually adding commands to Nightbot. There are two ways to add a Pokeitbot API command to NightBot:
- You can create a custom command by clicking the Add Command button on your commands page and then typing in "urlfetch" along with the Pokeit API endpoint.
- Paste one of the lines of code below into chat and NightBot will take care of the rest.
Basic API commands
To add the "session" endpoint to NightBot, use the command:
Where <username>
is your own Pokeit username. You can then switch out @<username>/session
with one of the other available endpoints.
API Commands with dynamic inputs
If one of the endpoints has a dynamic input like {player}
, {stat}
, or {num}
, replace that part of the NightBot command with a $(1)
. This will allow NightBot to pass along something like a player name or stat name without you needing to input each one separately. For example:
This will allow the text "!hand 25" to return the 25th hand in your session (or any other number). Commands with multiple dynamic inputs can use $(1)
, $(2)
, etc.