【问题标题】:creating paragraphs in embeds discord.py在嵌入 discord.py 中创建段落
【发布时间】:2021-08-29 21:49:30
【问题描述】:

我想在这样的嵌入中创建一个段落:

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="")

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

【问题讨论】:

  • 为什么不直接插入到描述中?

标签: discord discord.py


【解决方案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")

【讨论】:

    猜你喜欢
    • 2021-04-09
    • 2021-08-09
    • 2020-10-04
    • 2021-05-07
    • 1970-01-01
    • 2019-05-03
    • 2022-01-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多