A collection of utilities and tools for Twitch streamers
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.
-
Moderation
Announce
- Announce a message to the chatGame
- Change stream's gameShoutout
- Shoutout a userStream
- Change stream's title
-
Capitalism
Balance
- Check your balanceDaily
- Claim your daily rewardGamble
- Gamble your moneyGive
- Give money to another userWeekly
- Claim your weekly reward
-
Miscellaneous
Eat
- Chose a random food to eatHate
- How much do you hate someone?Help
- Show help messageLove
- How much do you love someone?Stomp
- Stomp on someone
-
Overlay & Customization
Nickname
- Change your nickname (Linked with the chat overlay)
-
Song Request
Song-Queue (sq)
- Show the music queueSong-Remove (rm)
- Remove a song from the queueSong-Skip (sk)
- Skip the current songSong-Request (sr)
- Add a song to the queue
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)
- Bun (Version 1.0.0 or higher is recommended)
- Twitch Developer Account (For the chat bot)
- Clone the repository
git clone https://github.com/tinarskii/twitch-utils.git
cd twitch-utils
- Install dependencies
bun install
- 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])
- Start the bot
bun start
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.
This project is licensed under the Mozilla Public License 2.0.
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.
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
.
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.