Skip to content

Commit

Permalink
Merge pull request #141 from adanalife/develop
Browse files Browse the repository at this point in the history
Release 5/16/2021
  • Loading branch information
dmerrick authored May 16, 2021
2 parents 67f52ad + a9cf0ba commit e1f855a
Show file tree
Hide file tree
Showing 13 changed files with 108 additions and 65 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ on:
- infra/docker

jobs:
# cancel any existing runs of this workflow on this branch
cancel-currently-running:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: rokroskar/[email protected]
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

build:
runs-on: ubuntu-latest
env:
Expand All @@ -35,7 +44,7 @@ jobs:
uses: actions/checkout@v1
- name: Fetch videos from cache
id: restore-videos
uses: actions/[email protected].4
uses: actions/[email protected].5
with:
path: assets/video
key: ${{ runner.os }}-video-${{ hashFiles('assets/video/manifest.txt') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: run-linters
uses: github/super-linter@v3.15.5
uses: github/super-linter@v3.17.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# disabled because it's not working with C libs
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
go-version:
- 1.14.x
- 1.15.x
- 1.16.x
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}

Expand All @@ -26,7 +27,7 @@ jobs:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v2
- name: Restore Cache
uses: actions/[email protected].4
uses: actions/[email protected].5
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/adanalife/tripbot)](https://goreportcard.com/report/github.com/adanalife/tripbot)
[![GitHub Super-Linter](https://github.com/adanalife/tripbot/workflows/Super%20Linter/badge.svg)](https://github.com/marketplace/actions/super-linter)
[![Version](https://img.shields.io/github/v/release/adanalife/tripbot?sort=semver&include_prereleases)](https://github.com/adanalife/tripbot/releases)
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fadanalife%2Ftripbot%2Fbadge&style=flat)](https://actions-badge.atrox.dev/adanalife/tripbot/goto)
[![License: CC BY-NC-SA 4.0](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
![Build Status](https://img.shields.io/github/checks-status/adanalife/tripbot/master)
[![License](https://img.shields.io/github/license/adanalife/tripbot)](https://tldrlegal.com/license/mit-license)

This is the source code to [whereisdana.today](http://whereisdana.today), a 24/7 interactive [slow-tv](https://en.wikipedia.org/wiki/Slow_television) art project.

Expand Down
12 changes: 3 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ module github.com/adanalife/tripbot
go 1.15

require (
cloud.google.com/go v0.73.0 // indirect
cloud.google.com/go/logging v1.1.2
cloud.google.com/go/logging v1.3.0
github.com/adrg/libvlc-go/v3 v3.1.2
github.com/bradfitz/latlong v0.0.0-20170410180902-f3db6d0dff40
github.com/davecgh/go-spew v1.1.1
Expand All @@ -21,7 +20,7 @@ require (
github.com/jonas-p/go-shp v0.1.1 // indirect
github.com/kelseyhightower/envconfig v1.4.0
github.com/kelvins/geocoder v0.0.0-20200113010004-f579500e9e27
github.com/lib/pq v1.9.0
github.com/lib/pq v1.10.0
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mitchellh/go-ps v1.0.0
Expand All @@ -35,11 +34,6 @@ require (
github.com/unrolled/secure v1.0.8
github.com/urfave/negroni v1.0.0
golang.org/x/image v0.0.0-20200927104501-e162460cd6b5 // indirect
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb // indirect
golang.org/x/oauth2 v0.0.0-20201203001011-0b49973bad19 // indirect
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
golang.org/x/tools v0.0.0-20201204222352-654352759326 // indirect
google.golang.org/genproto v0.0.0-20201204160425-06b3db808446 // indirect
google.golang.org/grpc v1.34.0 // indirect
googlemaps.github.io/maps v1.3.1
googlemaps.github.io/maps v1.3.2
)
80 changes: 45 additions & 35 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion infra/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ services:
restart: unless-stopped

db:
image: postgres:12
image: postgres:13
restart: always
ports:
- "5432"
Expand Down
8 changes: 7 additions & 1 deletion infra/docker/obs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ ENV VNC_PASSWD=123456
WORKDIR /tmp

ENV OBS_VERSION=26.1.2
ENV TINI_VERSION v0.19.0

# install obs and the obs-browser plugin
#TODO: re-enable browser plugin
Expand All @@ -119,6 +120,10 @@ RUN git clone --depth 1 --branch $OBS_VERSION https://github.com/obsproject/obs-
#TODO: possibly add obs-vst?
# && git clone https://github.com/obsproject/obs-vst ./plugins/obs-vst \

# add Tini (simple init)
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini

# add menu entries for fluxbox
RUN echo "?package(bash):needs=\"X11\" section=\"ADanaLife\" title=\"OBS Screencast\" command=\"obs\"" >> /usr/share/menu/danalol \
&& echo "?package(bash):needs=\"X11\" section=\"ADanaLife\" title=\"vlc-server\" command=\"cd /opt/tripbot && FONTCONFIG_PATH=/etc/fonts bin/vlc-server\"" >> /usr/share/menu/danalol \
Expand Down Expand Up @@ -146,4 +151,5 @@ RUN ln -s /go/src/github.com/adanalife/tripbot /opt/tripbot \
WORKDIR /opt/tripbot
RUN go build -o bin/vlc-server cmd/vlc-server/vlc-server.go

ENTRYPOINT ["/opt/tripbot/script/container_startup.sh"]
ENTRYPOINT ["/tini", "--"]
CMD ["/opt/tripbot/script/container_startup.sh"]
8 changes: 7 additions & 1 deletion infra/docker/tripbot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# buster is the debian release, c.p. https://askubuntu.com/a/445496
FROM golang:1.16.0-buster
FROM golang:1.16.4-buster

WORKDIR /go/src/github.com/adanalife/tripbot

# create app user
# RUN adduser --system --group --disabled-password --no-create-home danalol

# add Tini (simple init)
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini

# copy over project
#TODO: maybe just copy pkg, cmd, internal, etc?
COPY . .
Expand All @@ -28,4 +33,5 @@ RUN go build -o bin/tripbot cmd/tripbot/tripbot.go

EXPOSE 8080

ENTRYPOINT ["/tini", "--"]
CMD ["./bin/tripbot"]
9 changes: 5 additions & 4 deletions pkg/chatbot/chatbot.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ var Uptime time.Time
// randomized so it starts with a new one every restart
var helpIndex = rand.Intn(len(c.HelpMessages))

const followerMsg = "Follow the stream to run unlimited commands :)"
const followerMsg = "Right now only followers of the channel can run unlimited commands :)"
const subscriberMsg = "You must be a subscriber to run that command :)"

// Initialize returns a Twitch client struct with all of the various configuration in place.
func Initialize() *twitch.Client {
var err error
Uptime = time.Now()
Expand Down Expand Up @@ -91,10 +92,9 @@ func Whisper(username, msg string) {
client.Whisper(username, msg)
}

// Chatter is designed to most a randomized message on a timer
// right now it just posts random "help messages"
// Chatter is designed to post a randomized message on a timer.
// Right now it just posts random "help messages."
func Chatter() {
// rand.Intn(len(config.HelpMessages))
// use twitch emote feature to add some color
Say("/me " + help())
}
Expand All @@ -106,6 +106,7 @@ func help() string {
return text
}

// AnnounceNewFollower makes a post in chat that a user follows the channel
func AnnounceNewFollower(username string) {
msg := fmt.Sprintf("Thank you for the follow, @%s", username)
Say(msg)
Expand Down
2 changes: 1 addition & 1 deletion pkg/chatbot/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func runCommand(user *users.User, message string) {
}
case "!shutdown":
shutdownCmd(user)
case "!socialmedia":
case "!socialmedia", "!social", "!socials":
Say("Find me outside of Twitch: !twitter, !instagram, !facebook, !youtube")
case "!commands", "!controls":
Say("You can try: !location, !guess, !date, !state, !sunset, !timewarp, !miles, !leaderboard, and many other hidden commands!")
Expand Down
13 changes: 13 additions & 0 deletions pkg/config/tripbot/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,19 @@ var IgnoredUsers = []string{
"avocadobadado",
"bibiethumps",
"bingcortana",
"brokemystreamdeck",
"buglers",
"cartierlogic",
"casinothanks",
"clearyourbrowserhistory",
"comettunes",
"commanderroot",
"community4smallstreamers",
"communityshowcase",
"cristianepre",
"cyclemotion",
"d4rk_5ky",
"discord_for_streamers",
"droopdoggg",
"electricallongboard",
"eubyt",
Expand All @@ -70,8 +76,10 @@ var IgnoredUsers = []string{
"gingerne",
"gowithhim",
"havethis2",
"icantcontrolit",
"icewizerds",
"ildelara",
"jdlb",
"jeffecorga",
"jobi_essen",
"jointeffortt",
Expand All @@ -90,21 +98,26 @@ var IgnoredUsers = []string{
"nightbot",
"nuclearpigeons",
"p0lizei_",
"playacted",
"prankcher",
"rladmsdb88",
"rubberslayer",
"sad_grl",
"saddestkitty",
"shadowy_stix",
"sillygnome225",
"slocool",
"stickypigs",
"streamlabs",
"stygian_styx",
"talkingrobble",
"taormina2600",
"teresedirty",
"teyyd",
"tripbot4000",
"twitchdetails",
"unixchat",
"utensilzinc",
"v_and_k",
"violets_tv",
"virgoproz",
Expand Down
19 changes: 11 additions & 8 deletions pkg/onscreens-server/left-rotator.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,21 @@ var leftRotatorUpdateFrequency = time.Duration(45 * time.Second)
var leftRotatorFile = filepath.Join(c.Conf.RunDir, "left-message.txt")

var possibleLeftMessages = []string{
// "Looking for artist for emotes and more",
"Want to help the stream? Fill out the !survey",
"Want to help the stream? Fill out the !survey",
// "Twitch Prime subs keep us on air :D",
"Crave something new? Try !timewarp",
"Earn miles for every minute you watch (!miles)",
"Use !report to report stream issues",
"Follow the project elsewhere on !socialmedia",
"Join us on !discord",
"Join us on !discord",
"Try and !guess what state we're in",
"Use !commands to interact with the bot",
"Use !commands to interact with the bot",
"Want to help the project? Fill out the !survey",
"Want to help the project? Fill out the !survey",
"Where are we? (!location)",
"Crave something new? Try !timewarp",
"Talk to me on !socialmedia",
"New here? Use !commands to interact with the bot",
// "LEADER",
// "Looking for artist for emotes and more",
// "Twitch Prime subs keep us on air :D",
// "Use !report to report stream issues",
}

func InitLeftRotator() {
Expand Down

0 comments on commit e1f855a

Please sign in to comment.