Skip to content
p5nbTgip0r edited this page Jul 26, 2022 · 1 revision

This page gives a detailed walk-through of how to set up the bot.

Configuration: Twitch

For starters, we need to configure the Twitch-specific details. This will be two things: the login details which the chatbot will use, and the name of the Twitch channel(s) the bot should listen for Nightscout commands on.

The bot was designed to allow running it on a separate Twitch user, which is why we need to specify the channel and login names separately. Although it is possible, running the bot on a separate user isn't in the scope of this tutorial. We're just going to host it on your main Twitch account for the sake of simplicity.

  1. Open the generated config.yaml file in a text editor of some kind: VS Code, Notepad++, or even standard Notepad

  2. Replace my_twitch_username under twitch: and channels: with your Twitch username.

    GIF

    GIF: Replacing my_twitch_username under the twitch and channels nodes in the config file

  3. Generate an OAuth password here, then copy the password (be sure to include the oauth part at the beginning of it) into the configuration file under oauth.

    GIF

    GIF: Copying the OAuth generated at the twitchapps.com website and pasting it into the oauth key in the config file

At this point, it should look something like this:

Image

Image: Showing the changes made so far. Notably, the username and oauth keys have changed under twitch, and the my_twitch_username that was under the channels list is also changed

Configuration: Nightscout

Now that we've entered our Twitch details, we can begin configuring the Nightscout details.

  1. Replace https://your-nightscout.herokuapp.com/ with your Nightscout URL in the nightscout: section under channels

  2. If your Nightscout requires a token or API secret to read the data: Uncomment the token: line, and replace yourtoken-1111111111111111 with the token.

    GIF

    GIF: Removing the #  before token: and replacing the example value with the access token from the Nightscout admin page

Final Steps

Now, your config should look similar to this:

Image

Image: Showing the entire config with all of the previous changes applied. Since the image shown at the end of the Twitch section, the nightscout key under the channel has changed. token is no longer commented, and the url has changed to the user's Nightscout URL

Save the file and run the program again. If a console appears and says:

Image

Image: A console window showing two log messages: "Initializing bot.." and "Connected"

then the bot should be working! Go to your Twitch channel and type !ns in chat:

Image

Image: In a Twitch chat, a viewer says !ns and the streamer (running this bot) responds with diabetes data

Clone this wiki locally