Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d71fc2605 | |||
| c49a32a741 | |||
| e62ddaa19c |
@@ -1,40 +0,0 @@
|
||||
# This workflow will build a golang project
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
|
||||
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os: ["darwin","linux","windows"]
|
||||
arch: ["amd64","arm64"]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.19
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
go get .
|
||||
|
||||
- name: Build
|
||||
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o spotigram_${{ matrix.os }}_${{ matrix.arch }} -v main.go
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v3.1.2
|
||||
with:
|
||||
name: spotigram_${{ matrix.os }}_${{ matrix.arch }}
|
||||
path: spotigram_${{ matrix.os }}_${{ matrix.arch }}
|
||||
retention-days: 90
|
||||
@@ -3,8 +3,6 @@ Spotigram
|
||||
|
||||
_Wenns' gut werden muss_
|
||||
|
||||
[](https://git.jonasmoeller.de/aledjones/spotigram)
|
||||
|
||||
## Was ist Spotigram?
|
||||
|
||||
Spotigram ist eine `/command` basierte Bridge zwischen Telegram und Spotify.
|
||||
|
||||
+17
-2
@@ -101,8 +101,22 @@ It is not planned to extend this in the future.`,
|
||||
err = viper.WriteConfig()
|
||||
cobra.CheckErr(err)
|
||||
}
|
||||
results, err := client.Search(ctx, strings.TrimPrefix(update.Message.Text, "/spotigram "), spotify.SearchTypeTrack)
|
||||
|
||||
var results *spotify.SearchResult
|
||||
|
||||
if strings.HasPrefix(update.Message.Text, "/spotigram ") {
|
||||
results, err = client.Search(ctx, strings.TrimPrefix(update.Message.Text, "/spotigram "), spotify.SearchTypeTrack)
|
||||
cobra.CheckErr(err)
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(update.Message.Text, "/spotigram ") {
|
||||
msg.Text = "⛔ Ooops, du musst einen Titel angeben!\n <code>/spotigram [Titel]</code>"
|
||||
msg.ParseMode = "HTML"
|
||||
_, err = bot.Send(msg)
|
||||
cobra.CheckErr(err)
|
||||
|
||||
fmt.Printf("Command used incorrectly.")
|
||||
}
|
||||
|
||||
if results != nil {
|
||||
|
||||
@@ -145,7 +159,8 @@ It is not planned to extend this in the future.`,
|
||||
track.Name,
|
||||
track.Artists[0].Name)
|
||||
|
||||
} else {
|
||||
}
|
||||
if !contains(trackIDs, results.Tracks.Tracks[0].ID) {
|
||||
track := results.Tracks.Tracks[0]
|
||||
|
||||
addTrackResponse, err := client.AddTracksToPlaylist(ctx,
|
||||
|
||||
Reference in New Issue
Block a user