Repo to keep my community's twitch gadgetries. Join me at www.twitch.tv/armzi.
$ git clone https://github.com/thananon/twitch_tools.git
$ cd twitch_tools
$ npm install
Use through docker-compose.yml
Change the configuration to your channel and the database path.
version: "3.9"
services:
9armbot:
build:
context: .
dockerfile: Dockerfile
volumes:
+ - ./9armbot/botstat.json:/twitch_tools/9armbot/botstat.json
+ - ./9armbot/players.json:/twitch_tools/9armbot/players.json
- type: bind
+ source: ./9armbot/oauth_token
target: /twitch_tools/9armbot/oauth_token
read_only: true
environment:
- twitch_api=https://tmi.twitch.tv
+ - tmi_username=9armbot
+ - tmi_channel_name=armzi
+ - admin_username=armzi
$ docker-compose up
Use through NodeJs
Change the configuration to your channel in .env
file and copy oauth token to 9armbot/oauth_token
.
twitch_api="https://tmi.twitch.tv"
+tmi_username="9armbot"
+tmi_channel_name="armzi"
+admin_username="armzi"
$ npm install
$ npm start
More information about
oauth_token
here.
.env
, modify names and credentials, then save it as .env.local
(This file is Git-ignored)npm run db:migrate
npm run dev-2.0
npm run test-2.0
npm run db:studio
$ npm run console
$ npm run db:studio
npm run db:generate
, name the schema (eg. "Add is_admin field"
), SQL migration file will be created..sql
file at prisma/migrationsnpm run db:migrate
to apply changes to your database (Note: This action cannot be reversed easily without resetting your schema (Ref).)