mirror of
https://github.com/aditya-K2/gspt.git
synced 2026-01-09 13:58:05 -05:00
29 lines
573 B
Go
29 lines
573 B
Go
package spt
|
|
|
|
import (
|
|
"github.com/zmb3/spotify/v2"
|
|
)
|
|
|
|
func play(options *spotify.PlayOptions) error {
|
|
return Client.PlayOpt(ctx(), options)
|
|
}
|
|
|
|
func PlaySong(uri spotify.URI) error {
|
|
return play(&spotify.PlayOptions{
|
|
URIs: []spotify.URI{uri},
|
|
})
|
|
}
|
|
|
|
func PlaySongWithContext(context *spotify.URI, position int) error {
|
|
return play(&spotify.PlayOptions{
|
|
PlaybackContext: context,
|
|
PlaybackOffset: &spotify.PlaybackOffset{Position: position},
|
|
})
|
|
}
|
|
|
|
func PlayContext(context *spotify.URI) error {
|
|
return play(&spotify.PlayOptions{
|
|
PlaybackContext: context,
|
|
})
|
|
}
|