Skip to content

Commit

Permalink
Merge branch 'main' of github.com:medgelabs/stream-bot into main
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewEdge committed Nov 14, 2020
2 parents ee7a41c + c6d4402 commit 4eb1d1a
Showing 1 changed file with 66 additions and 9 deletions.
75 changes: 66 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,43 @@
# Stream Bot

Twitch ChatBot built on stream!
Twitch ChatBot built on stream! Utilizes Twitch IRC and Twitch PubSub APIs to
interact with Twitch Chat.

* All messages sent _FROM_ the bot _TO_ chat are done via IRC PRIVMSG commands
* PubSub is used for Subscriptions, Point Redemptions, and Bits since IRC does not send these

## Build & Run

The bot should compile to Windows/Mac/Linux native binaries with `go build`.
Linux and Mac have been tested. (Sorry Windows)

## CLI

The Bot is a CLI-based program and accepts CLI flags to configure behavior. Run the
binary with the `-h` flag to see available options.

## Secrets

Secrets required by the app:

* Twitch OAuth token

A `Secret Store` provides these to the app (`/secrets` package). Currently supported options
are:

* Hashicorp Vault (available via `docker-compose up vault`)
* Secret is expected under `secrets/twitchToken`
* Environment variable: `TWITCH_TOKEN`

https://twitch.tv/medgelabs


## Greeter

Auto-Greeter will greet viewers on their first chat message. It does NOT greet
lurkers!
lurkers (i.e no greetings on JOIN / PART)!

The message is a Go fmt-style string stored in `config.yaml`. Different messages
The message sent is a Go fmt-style string stored in `config.yaml`. Different messages
can be set for different channels:

```
Expand All @@ -24,22 +52,51 @@ The only variable injected is the username. Any other substitutions are ignored.

Commands are currently set in code in the `bot/commandHandler.go` file.

## TODO - Followers / Subscribers
## TODO - Subscribers

Followers / Subscribers can be sent a message automatically. The message sent is
Subscribers can be sent a message on a new subscription. The message sent is
found in `config.yaml` and can be set for different channels:

```
followers:
CHANNEL_NAME:
messageFormat: "Thanks for the follow, @%s!"
subscribers:
CHANNEL_NAME:
messageFormat: "Thanks for the subscription, @%s!"
messageFormat: "Thank you for the subscription, @%s!"
```

The only variable injected is the username. Any other substitutions are ignored.

TODO resub?

## TODO - Followers

Followers API doesn't appear to be in IRC or PubSub. Needs investigation

## TODO - Bits

## TODO - Emote Stats

If enabled, and by setting the following `config.yaml` entry:

```
emotes:
CHANNEL_NAME:
prefix: medgel (YOU'RE EMOTE PREFIX HERE)
```

The bot will analyze messages for usages of emotes with the given prefix. A single
emote is only counted once per message (i.e sending the same emote 4 times in one
message will only count as 1 usage).

TODO - how are these accessed?

## TODO - QoL

* Use Mustache for message strings for more options?
* Simplify config.yaml to be channel-top to simplify for multiple features. i.e:
```
CHANNEL_NAME:
greeter:
messageFormat: "..."
```
* Config without YAML file for more portability / quick-run?
* Automated OAuth token

0 comments on commit 4eb1d1a

Please sign in to comment.