Skip to content

FBoucher/CloudBot

Repository files navigation

Cloud Bot

Release Docker Image CI Build Beta Docker Images

All Contributors

Simple Twitch chatbot for Twitch Stream, build with Comfy.JS.

cloudbot logo

First it was a pretext to learn (or refresh) my JavaScript knowledge, but it became quickly fun to add more and more feature to it. Have a look customize it. make suggestion... this is pure fun. :)

Currently Available Commands

Games:

  • !stats: Display current user stats

Sounds:

  • !bonjour: play sound "Bonjour Hi" 3 different version at random
  • !bad: play sound "Bonjour Hi"
  • !yeah: play sound "Yeeeeeeaaaah!"
  • !knock : Play sound "Realistic knock on a door"
  • !previously : Play sound "Previously on Frank's channel" said by Jeff Fritz

CB:

  • !cloud : Show CD (aka Cloud Bot) GIF

Tools:

  • !time : Add a time log to the show notes (those are used to create timestamps on YouTube)
  • !attention : Play a notification sound and draw the text in the screen.
  • !note : Add a note/ code snippet / url useful during the stream
  • !cmd, !command, !commands: Display in the chat the URL back to this list.
  • !referal, !referals: Display in the chat the URL(s) of Frank's referal(s).
  • !livecoder, !livecoders: Provide more info about Live Codersin the chat.

Only Broadcaster:

  • !scores: display table of highest scores

  • !clean: hide/ clean all previous text in the screen

  • !load: Load the file containing the previous session data.

  • !save: Save in a local file streamSession.json the current session data.

  • !talk: The bot will repete the message

  • !so : shout-out! to user.

  • !todo-add : Add a new To-Do

  • !todo-start : Set the identified To-Do as active

  • !todo-cancel : Set the identified To-Do as cancelled

  • !todo-done : Set the identified To-Do as done/ closed

  • !reminder-add | reminder description: Create a new reminder.

  • !reminder-stop : Set the reminder with the name equal to to DONE.

  • !reminder-pause : Pause the reminder with the name equal to . Set its status to inactive.

Upcomming Available Commands

  • lift
  • etc.

How to use it

Directly from the code

The Cloudbot now required a server. A tiny one but it's not a static HTML web page anymore. It's using Node.js. You can run it locally or host it somewhere (ex: Azure). If you decide to run it locally execute: npm start from inside the folder src.

Make a new browser source overlay into your streaming tools (ex: OBS, StreamLabs OBS) and connect it to the root url where the server is running. (ex: http://localhost:3000.

Create a file secret.js with the following code in it:

const authToken = "oauth:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx";

Replace the token by the value found on: https://twitchapps.com/tmi/

Finally replace fboucheros by the name of your Twitch Channel on the last line.

 ComfyJS.Init( "fboucheros", authToken );

Using Docker Container

This project is now available in a container. You can find it on: https://hub.docker.com/repository/docker/fboucher/cloudbot

  • The container by default uses the port 3000, you can map it to a different one if you want to keep 3000 available for some other node development (in the command below, the chat bot will be available at http://localhost:3001).

  • The ${PWD} is the current local folder on the host. This folder MUST CONTAINED:

    • a file secret.js with a auth key in it.

      const authToken = "oauth:____________________";
    • a file streamSession.json To initialize the sessions.

      {
        "Project": "",
        "Id": 42,
        "DateTimeStart": "",
        "DateTimeEnd": "",
        "Notes": [],
        "UserSession": [],
        "NewFollowers": [],
        "Raiders": [],
        "Subscribers": [],
        "Hosts": [],
        "Cheerers": [],
        "TimeLogs": [],
        "Todos": [],
        "Reminders": []
      }

Here an example how to instantiate the chatbot.

docker run -p 3001:3000 -d -v ${PWD}:/usr/src/app/io  --name ceebee fboucher/cloudbot:latest

Then on stream in the chat type !start [projectName]

~ Have fun!


Contributors ✨

Thanks goes to these wonderful people (emoji key):


Frank Boucher

📖 💻 🤔

SurlyDev

🤔

This project follows the all-contributors specification. Contributions of any kind welcome!