”LarryBot” is an automated dog treat dispenser that let’s live viewers on Twitch.tv give treats to a good boy on command.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


"LarryBot" is an automated dog treat dispenser that let's live viewers on Twitch.tv give treats to a good boy on command.

See full blog post at https://www.tylerpearce.ca/twitch-dog-treat-dispenser-bot/


The server is a Node.js/Express server and can be run locally on your machine.


  • Node.js
  • Python
  • npm install --global --production windows-build-tools (If on windows)
  • Setup a MongoDB database (e.g. MLab)
  • Add 3 collections to database 'treats', 'admins', 'settings'
  • Add initial document to 'settings' collection.
    { "type": "system", "systemStatus": 1 }
  • Add your Twitch Username in a new document to the 'admins' collection. This lets you bypass the cooldown restrictions that other users would have. You can add as many admins as you would like (e.g. channel mods)
    { "name": "YourTwitchName" }
  • Setup a MQTT server (e.g. EMQTT or CloudMQTT)
  • Create a new Twitch account to be used as your bot user
  • Generate your OAuth Password for the bot account at https://twitchapps.com/tmi/
  • Create a file called .env in the root of your server directory. Add the following replaced with your information and save
TWITCH_BOT_OAUTH="oauth:YourOauthKey Get from https://twitchapps.com/tmi/"  
SLTOKEN="YourStreamLabsToken If you want to give treats when someone follows automatically. Go to your https://streamlabs.com/dashboard#/apisettings > API Tokens to find your token"  
  • Run npm install
  • Start the server with node server

The dashboard can be accessed at http://localhost:8090

The Robot

Robot Schematic The source code here is only for the dispenser. The LED strip lighting source code is not included at the moment. Take a look into NeoPixelBus as there can be conflicts with servos/interrupts and LED strips.

See Waltermixxx's Thingiverse & post for information on building the 3D printed dispenser. I used 3DHubs for printing.

Robot Schematic

This is the IR beam splitter I used and the servo

I used an EMQTT broker running on the same machine as the Express server to be my MQTT server, rather than using a free cloud MQTT server, it was much faster and more reliable. If you do this, you should go into your router and assign a dedicated IP address to your computer running the server so the arduino/esp8266 can connect easily (e.g.

You may need to download and add certain dependencies that are missing. This was developed for use on a NodeMCU/ESP8266 board, but can likely be easily modified to work with an Arduino

WifiManager library is being used for wifi. On the first run, a wifi access point will be available that you can connect to from your phone. From there you can configure your wifi settings.

Update the MQTT server settings with your own.