символ 🅴 заменяю на [E] в строке с треком

design
serr 2025-05-20 14:26:09 +03:00
parent 07ef43e7fd
commit 6c46ce117c
1 changed files with 2 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import (
"fmt"
"io"
"net/http"
"strings"
)
type LastFMTrack struct {
@ -54,6 +55,7 @@ func LastFMGetLastTrack(username, apiKey string) (string, error) {
if len(resp.RecentTracks.Tracks) > 0 {
track := resp.RecentTracks.Tracks[0]
data = fmt.Sprintf("%s - %s", track.Name, track.Artist.Name)
data = strings.ReplaceAll(data, "🅴", "[E]")
} else {
return "", fmt.Errorf("len(resp.RecentTracks.Tracks) <= 0")
}