Skip to content

Commit

Permalink
Merge pull request #170 from adanalife/develop
Browse files Browse the repository at this point in the history
Release 5/22/2021
  • Loading branch information
dmerrick authored May 23, 2021
2 parents e1f855a + ab2fc34 commit 13adc0b
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 58 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ name: "CodeQL"

on:
push:
branches: [ develop ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]
branches: [ main ]
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: rokroskar/[email protected].2
- uses: rokroskar/[email protected].3
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--disable-all -E errcheck"
level: info

misspell:
name: misspell
Expand All @@ -42,4 +41,5 @@ jobs:
with:
github_token: ${{ secrets.github_token }}
locale: "US"
level: info
# ignore the chat handlers file cause it has many typos
exclude: pkg/chatbot/handlers.go
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ module github.com/adanalife/tripbot
go 1.15

require (
cloud.google.com/go/logging v1.3.0
cloud.google.com/go/logging v1.4.2
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
github.com/dimiro1/banner v1.1.0
github.com/gempir/go-twitch-irc/v2 v2.5.0
github.com/getsentry/sentry-go v0.10.0
github.com/getsentry/sentry-go v0.11.0
github.com/go-sql-driver/mysql v1.5.0 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/gorilla/mux v1.8.0
Expand All @@ -20,18 +20,18 @@ 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.10.0
github.com/lib/pq v1.10.1
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
github.com/nathan-osman/go-sunrise v0.0.0-20201029015502-9a83cd1a5746
github.com/nicklaw5/helix v1.7.0
github.com/prometheus/client_golang v1.9.0
github.com/nicklaw5/helix v1.16.0
github.com/prometheus/client_golang v1.10.0
github.com/robfig/cron v1.2.0
github.com/sfreiberg/gotwilio v0.0.0-20200916182813-169c4cd5c691
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/slok/go-http-metrics v0.9.0
github.com/unrolled/secure v1.0.8
github.com/unrolled/secure v1.0.9
github.com/urfave/negroni v1.0.0
golang.org/x/image v0.0.0-20200927104501-e162460cd6b5 // indirect
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
Expand Down
113 changes: 77 additions & 36 deletions go.sum

Large diffs are not rendered by default.

27 changes: 18 additions & 9 deletions pkg/chatbot/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,18 @@ func runCommand(user *users.User, message string) {
}
}

// handle case where people add a space (like "! location")
if command == "!" {
command = command + params[0]
// remove the first element from the params
params = params[1:]
}

switch command {
case "!help":
incChatCommandCounter("!help")
helpCmd(user)
case "hello", "hi", "hey", "hallo":
case "hello", "hi", "hey", "hallo", "!bot":
incChatCommandCounter("hello")
helloCmd(user, params)
case "!flag":
Expand All @@ -55,7 +62,7 @@ func runCommand(user *users.User, message string) {
versionCmd(user)
case "!uptime":
uptimeCmd(user)
case "!timewarp", "!tw":
case "!timewarp", "!timewrap", "!timeskip", "!tw", "!timewqrp", "!warp":
if user.HasCommandAvailable() {
timewarpCmd(user)
} else {
Expand Down Expand Up @@ -83,33 +90,33 @@ func runCommand(user *users.User, message string) {
shutdownCmd(user)
case "!socialmedia", "!social", "!socials":
Say("Find me outside of Twitch: !twitter, !instagram, !facebook, !youtube")
case "!commands", "!controls":
case "!commands", "!command", "¡command", "¡commands", "!commads", "!controls", "!commande":
Say("You can try: !location, !guess, !date, !state, !sunset, !timewarp, !miles, !leaderboard, and many other hidden commands!")
case "!bonusmiles":
if user.IsSubscriber() {
bonusMilesCmd(user)
} else {
Say(subscriberMsg)
}
case "!sunset":
case "!sunset", "!sunet":
if user.HasCommandAvailable() {
sunsetCmd(user)
} else {
Say(followerMsg)
}
case "!time":
case "!time", "!timr":
if user.HasCommandAvailable() {
timeCmd(user)
} else {
Say(followerMsg)
}
case "!date":
case "!date", "!datw":
if user.HasCommandAvailable() {
dateCmd(user)
} else {
Say(followerMsg)
}
case "!guess":
case "!guess", "!guss", "guess", "!gusss", "!guees", "!gues", "!quess", "!guis":
if user.HasCommandAvailable() {
guessCmd(user, params)
} else {
Expand All @@ -123,6 +130,8 @@ func runCommand(user *users.User, message string) {
}
case "!secretinfo":
secretInfoCmd(user)
case "!gas", "!fuel", "!petrol":
Say("About full, thanks for asking")
case "!middle":
middleCmd(user, params)
// any of these should trigger the miles command
Expand All @@ -143,15 +152,15 @@ func runCommand(user *users.User, message string) {

// any of these should trigger the location command
//TODO: add support for: "where is this", "where are we", "where are you"
case "!tripbot", "!location", "!locton", "!locaton", "!locatoion", "1location", "!city", "!town":
case "!tripbot", "!location", "!city", "!town", "!where", "!loacation", "!loation", "!loc", "!locatioin", "!locatoion", "!locaton", "!loclistion", "!locton", "1location", "¡location", "!locatiom", "!location!", "!locatio":
if user.HasCommandAvailable() {
locationCmd(user)
} else {
Say(followerMsg)
}

// trigger the leaderboard command
case "!leaderboard", "!monthlyleaderboard", "!lb", "!mlb":
case "!leaderboard", "!monthlyleaderboard", "!lb", "!mlb", "!leaderbord", "!ldb", "!ldbd":
if user.HasCommandAvailable() {
monthlyMilesLeaderboardCmd(user)
} else {
Expand Down
6 changes: 6 additions & 0 deletions pkg/config/tripbot/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func UserIsIgnored(user string) bool {
// https://twitchinsights.net/bots
var IgnoredUsers = []string{
"0_applebadapple_0",
"2020",
"abbottcostello",
"angeloflight",
"anotherttvviewer",
Expand Down Expand Up @@ -75,6 +76,7 @@ var IgnoredUsers = []string{
"ghrly",
"gingerne",
"gowithhim",
"hades_osiris",
"havethis2",
"icantcontrolit",
"icewizerds",
Expand All @@ -95,6 +97,7 @@ var IgnoredUsers = []string{
"mrreflector",
"mslenity",
"n3td3v",
"nerdydreams",
"nightbot",
"nuclearpigeons",
"p0lizei_",
Expand All @@ -108,6 +111,7 @@ var IgnoredUsers = []string{
"sillygnome225",
"slocool",
"stickypigs",
"stormmunity",
"streamlabs",
"stygian_styx",
"talkingrobble",
Expand All @@ -116,6 +120,8 @@ var IgnoredUsers = []string{
"teyyd",
"tripbot4000",
"twitchdetails",
"twitchgrowthdiscord",
"underworldnaiad",
"unixchat",
"utensilzinc",
"v_and_k",
Expand Down

0 comments on commit 13adc0b

Please sign in to comment.