diff --git a/bot/bot.go b/bot/bot.go index af63c4d..69b8565 100644 --- a/bot/bot.go +++ b/bot/bot.go @@ -64,6 +64,7 @@ func (b *BotServer) botListener(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusBadRequest) } + // TODO: Make this more safe when there are missing fields. if message, ok := jsonBody["message"].(map[string]interface{}); ok { messageText := message["text"].(string) if url := xurls.Strict.FindString(messageText); url != "" { diff --git a/bot/handler_test.go b/bot/handlers_test.go similarity index 100% rename from bot/handler_test.go rename to bot/handlers_test.go diff --git a/packages/build_snap.sh b/packages/build_snap.sh index f81097b..d9e24cd 100755 --- a/packages/build_snap.sh +++ b/packages/build_snap.sh @@ -15,4 +15,5 @@ else sed -i "s/{{grade}}/stable/" snap/snapcraft.yaml fi +snapcraft clean snapcraft diff --git a/packages/snap/snapcraft.yaml.template b/packages/snap/snapcraft.yaml.template index 0108879..eeb6a3f 100644 --- a/packages/snap/snapcraft.yaml.template +++ b/packages/snap/snapcraft.yaml.template @@ -15,14 +15,16 @@ parts: plugin: dump stage-packages: [ youtube-dl ] stage: + - squirrelbot - bin/* - usr/* prime: + - squirrelbot - bin/* - usr/* apps: squirrelbot: - command: env SQUIRRELBOT_CONFIG_FILE="$SNAP_COMMON/config.yaml" "$SNAP/bin/squirrelbot" + command: env SQUIRRELBOT_CONFIG_FILE="$SNAP_COMMON/config.yaml" "$SNAP/squirrelbot" daemon: simple plugs: [ home, network, network-bind ]