Skip to content

tinarskii/twitch-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Tinarskii's Twitch Utils

A collection of utilities and tools for Twitch streamers

wakatime

Table of Contents

πŸ€” About

This repo is a collection of utilities and tools for my Twitch channel (tinarskii). Inspired from thananon/twitch_tools and lucidkarn/luciabot. The project is written in TypeScript and uses Bun instead of Node.js, many features may be unavailable or not working as expected if you are not using Bun.

πŸ“ Features

Chat bot

  • Moderation

    1. Announce - Announce a message to the chat
    2. Game - Change stream's game
    3. Shoutout - Shoutout a user
    4. Stream - Change stream's title
  • Capitalism

    1. Balance - Check your balance
    2. Daily - Claim your daily reward
    3. Gamble - Gamble your money
    4. Give - Give money to another user
    5. Weekly - Claim your weekly reward
  • Miscellaneous

    1. Eat - Chose a random food to eat
    2. Hate - How much do you hate someone?
    3. Help - Show help message
    4. Love - How much do you love someone?
    5. Stomp - Stomp on someone
  • Overlay & Customization

    1. Nickname - Change your nickname (Linked with the chat overlay)
  • Song Request

    1. Song-Queue (sq) - Show the music queue
    2. Song-Remove (rm) - Remove a song from the queue
    3. Song-Skip (sk) - Skip the current song
    4. Song-Request (sr) - Add a song to the queue

Overlay

  • Chat Overlay - Show chat messages on the stream (Nickname command linked)
  • Event Feed - Show recent events on the stream (Linked with economic commands)
  • Music Player - Play music on the stream (Click now-playing box to hide the video)
  • Music Queue - Show the music queue on the stream (Linked with the music player)

πŸ› οΈ Installation

Prerequisites

Setup

  1. Clone the repository
git clone https://github.com/tinarskii/twitch-utils.git
cd twitch-utils
  1. Install dependencies
bun install
  1. Create a .env file in the root directory and add the following environment variables
CLIENT_ID= # Read FAQ to get your creditentials
CLIENT_SECRET= # Read FAQ to get your creditentials
USER_ACCESS_TOKEN= # Read FAQ to get your creditentials
REFRESH_TOKEN= # Read FAQ to get your creditentials
TW_CHANNEL= # Your channel name
TW_ID= # Your channel ID (You can get it from the Twitch API or this site: https://www.streamweasels.com/support/convert-twitch-username-to-user-id)
NODE_ENV= # Set it to "production" if you are running the bot in production
OVERLAY_TOKEN= # A random string to authenticate the overlay (E.g. /chat-[your-token])
  1. Start the bot
bun start

πŸ‘‹ Contributing

If you want to contribute to the project, please read the CONTRIBUTING.md file. However, if you have any questions, feel free to ask in the Discord server.

πŸ“œ License

This project is licensed under the Mozilla Public License 2.0.

πŸ™‹β€β™‚οΈ FAQ

How do I get my Twitch API credentials?

You can get your Twitch API credentials by creating a new application on the Twitch Developer Portal. Get your ClientID and Client Secret from the application's dashboard. After that, you can install TwitchCLI and run the following command to get your access token:

twitch token -u -s "user:edit user:read:email chat:read chat:edit channel:moderate moderation:read moderator:manage:shoutouts channel:manage:moderators channel:manage:broadcast channel:read:vips channel:read:subscriptions channel:manage:vips"

You will receive a user access token and a refresh token, add them to your .env file.

What's server.crt and server.key files?

These files are used to run the webserver in HTTPS. If you want to use HTTPS, you can generate these files using OpenSSL or other tools. If you don't want to use HTTPS, you can remove the server.crt and server.key in server/server.ts.

I couldn't install Bun in my system

Currently, Bun is only available for Linux and MacOS. If you are using Windows, you can use WSL or a virtual machine to run the project. For the WSL installation, you can follow the official documentation.