簡體   English   中英

當我使用 Genius API 時,它沒有給我完整的歌詞

[英]When I use the Genius API, it doesn't give me the full lyrics

當我運行此代碼 (discord.py) 時,我沒有得到完整的歌詞:

@commands.command()
async def lyrics(self, ctx, arg1, arg2):
    song = genius.search_song(arg2, arg1)
    print(song)
    embedgenius = discord.Embed(title=arg2.capitalize(), description=arg1.capitalize(), colour=0x69ff00)
    embedgenius.add_field(name="Lyrics:", value=song)
    await ctx.send(embed=embedgenius)

我只是明白:

示例 Polo G - Rapstar:

"RAPSTAR" by Polo G:
[Intro]
(Shout out my n**** Synco)

[Chorus]
Uh (Tuned up), copped a BMW, new deposit, I picked up a...

您將歌曲設置為值,而不是歌詞。

embedgenius.add_field(name="歌詞:", value=song)

您基本上是在打印歌曲對象,其中包含部分歌詞只是巧合。 要打印歌曲的歌詞,請使用song.lyrics 但是您應該記住,嵌入字段限制為 1024 個字符。


@commands.command()
async def lyrics(self, ctx, arg1, arg2):
    song = genius.search_song(arg2, arg1)
    print(song.lyrics)
    embedgenius = discord.Embed(title=arg2.capitalize(), description=arg1.capitalize(), colour=0x69ff00)
    embedgenius.add_field(name="Lyrics:", value=song.lyrics)
    await ctx.send(embed=embedgenius)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM