diff options
| author | Bobby <[email protected]> | 2025-04-13 18:10:13 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2025-04-13 18:10:13 +0530 |
| commit | 12fb3704db217cc408b662ec73cdd41e028c0e08 (patch) | |
| tree | 4cd3a34898d362773d77a31e03695cb2480286c7 /types | |
| parent | 1b271061415b33a8f18d1d3d960bc750b9557b69 (diff) | |
| download | ai-12fb3704db217cc408b662ec73cdd41e028c0e08.tar.xz ai-12fb3704db217cc408b662ec73cdd41e028c0e08.zip | |
implement play command; music playback working
Diffstat (limited to 'types')
| -rw-r--r-- | types/music.go | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/types/music.go b/types/music.go new file mode 100644 index 0000000..aa41fa7 --- /dev/null +++ b/types/music.go @@ -0,0 +1,59 @@ +package types + +type SourceType string + +const ( + YouTube SourceType = "youtube" + Spotify SourceType = "spotify" +) + +type MusicSearchResult struct { + Title string + Artist string + URL string + ID string + Duration string + Thumbnail string + SourceType SourceType +} + +type SpotifySearchResponse struct { + Tracks struct { + Items []struct { + ID string `json:"id"` + Name string `json:"name"` + Artists []struct { + Name string `json:"name"` + } `json:"artists"` + Album struct { + Images []struct { + URL string `json:"url"` + } `json:"images"` + } `json:"album"` + DurationMs int `json:"duration_ms"` + ExternalUrls struct { + Spotify string `json:"spotify"` + } `json:"external_urls"` + } `json:"items"` + } `json:"tracks"` +} + +type YouTubeSearchResponse struct { + Items []struct { + ID struct { + VideoID string `json:"videoId"` + } `json:"id"` + Snippet struct { + Title string `json:"title"` + ChannelTitle string `json:"channelTitle"` + Thumbnails struct { + Default struct { + URL string `json:"url"` + } `json:"default"` + High struct { + URL string `json:"url"` + } `json:"high"` + } `json:"thumbnails"` + } `json:"snippet"` + } `json:"items"` +} |
