GithubHelp home page GithubHelp logo

ilotterytea / bot Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 9.24 MB

ilotterytea's twitch bot

Home Page: https://bot.ilotterytea.kz

License: Do What The F*ck You Want To Public License

CSS 0.70% HTML 7.38% Rust 91.69% Dockerfile 0.23%
bot chatbot twitch rust actix-web html tokio-rs tungstenite

bot's Introduction

ilotterytea's rustpilled bot

A utility and entertainment multi-chat Twitch bot.

Features

  • Listening to the stream start/end and notifying chatters.
  • Sending messages in intervals (like timers)
  • PostgreSQL database support
  • Ping all chatters with a message (massping)
  • Counting emote usage

Installation guide

Clone the git repository

git clone https://git.ilotterytea.kz/tea/bot.git
cd bot

Create the configuration file

POSTGRES_USER=db_user
POSTGRES_DB=db_name
POSTGRES_PASSWORD=db_password
POSTGRES_HOSTNAME=db

BOT_USERNAME=YYYYYY
BOT_PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

# if you want github features
GITHUB_API_TOKEN=ghp_XXXXXXXXXXXXXXXX

You must generate an OAuth2 password from TwitchTokenGenerator with special scopes for bot, because this password is used not only for chat communication, but also for commands that use Twitch API endpoints that can only be accessed with special permissions (for example, !massping requires moderator:read:chatters).

If you are going to use Docker, then POSTGRES_HOSTNAME must be equal to db (POSTGRES_HOSTNAME=db)

If you are going to run it yourself (via cargo run), POSTGRES_HOSTNAME must equal localhost or IP address if the server is not local (e.g. POSTGRES_HOSTNAME=localhost).

Startup

  1. Via Docker Compose
docker-compose up

The installation will take up about 10-11 gigabytes of space.

  1. Manually
  • Twitch bot: cargo run --release --package bot
  • API: cargo run --release --package api
  • Web: cd web && npm run build && npm start

Enabling emote usage counting (optional)

  1. Clone the git repository of ilotterytea/stats
git clone https://git.ilotterytea.kz/tea/stats.git
cd stats
  1. Follow the installation steps in the ilotterytea/stats's README file

  2. Add these fields to the bot's configuration

STATS_API_HOSTNAME=XXXXXX
STATS_API_PASSWORD=AAAAAA:BBBBBB

STATS_API_PASSWORD is optional unless you set reverse proxy authentication for the /join and /part endpoints mentioned in the stats's README file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.