A Twitch Bot, in Ruby
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.7 KiB

  1. # TwitchChatbot
  2. A simple chatbot for Twitch written in Ruby. Used for handling commands and previewing chat so that you don't need to have the browser open and can avoid using a lot of RAM and CPU.
  3. ----
  4. ## Preview
  5. ![alt text](https://i.imgur.com/QOuqtfS.png "Preview of the chat bot")
  6. ----
  7. I use this chatbot to preview chat without having a browser open so that I save CPU and RAM.
  8. But as you can see in the preview image it's also able to handle custom commands including API commands.
  9. ----
  10. ## How To Use:
  11. 1. Open **"credentials.txt"** and replace OAUTH, BOTNAME and CHANNEL with the values you need.
  12. 2. Run **"TwitchBot.rb"**
  13. **Adding Commands:**
  14. 1. Open **"CommandsHandler.rb"** and scroll down to the `commands` array and add your own.
  15. 2. Go to folder **"Responses"** and add the command as a text file in all lowercase. _Examples have been included_
  16. If you are adding admin commands add a custom response next to it. There you'll be able to add commands that gives data to the socket instead of a chat message as a response. Example:
  17. `admin_commands = {
  18. "disconnect" => "PART ##{CHANNEL}"
  19. }`
  20. When the command `"!disconnect"` has been typed in chat by the channel owner it will send a request to disconnect from the current Twitch channel._
  21. ![alt text](https://i.imgur.com/iYtSvaG.png "Prefix, commands and admin commands")
  22. ----
  23. ## Extras:
  24. _**The response files in the Responses folder have 3 arguments available**_ (You can add your own)
  25. ![alt text](https://i.imgur.com/Pb6JPz8.png "Preview of command arguments")
  26. In the template the arguments USER, CHANNEL, COMMANDS are available. _(COMMANDS shows all available commands)_
  27. ![alt text](https://i.imgur.com/vX2XFof.png "Here you can add your replacements")