在嵌入 discord.py 中创建段落

时间:2021-06-13 21:00:26

标签: discord discord.py

我想在嵌入中创建一个段落,如下所示:

desc1 = ("
criteria for Youtuber role: 
over 50 subscribers 
upload at least once a month

criteria for Twitch Streamer role: 
Over 50 followers 
stream once a month")
aembed=discord.Embed(title="New @Youtuber and @Twitch Streamer roles", description=(desc1), colour=discord.Color.blue(), url="")

不像我现在所拥有的:

desc1 = ("criteria for Youtuber role: over 50 subscribers, upload at least once a month, criteria for Twitch Streamer role: Over 50 followers, stream once a month")
aembed=discord.Embed(title="New @Youtuber and @Twitch Streamer roles", description=(desc1), colour=discord.Color.blue(), url="")

每次我尝试第一个时,我都会收到一条错误消息,因为它不再是文本的一部分 我已经试过块括号和逗号

1 个答案:

答案 0 :(得分:1)

使用三重引号应该有效

desc1 = """
criteria for Youtuber role: 
over 50 subscribers 
upload at least once a month

criteria for Twitch Streamer role: 
Over 50 followers 
stream once a month"""

这也有效

desc1 = ("criteria for Youtuber role:\n"
         "over 50 subscribers\n"
         "upload at least once a month\n"
         "criteria for Twitch Streamer role:\n"
         "Over 50 followers\n"
         "stream once a month")