My bot Embeddes将与整个列表一起作为一个字符串发布,而不是在同一字段中分成多个条目。我很不明白为什么会这样。感谢您的帮助
代码:
fcfile = open(".env")
envlist = fcfile.readlines()
fcfile.close()
names = envlist[4].lower()
names = names.strip('\n')
namelist = names.split('.')
namelist.remove('')
print('Listing active carriers')
embed = discord.Embed(title='Tracked carriers')
embed.add_field(name = 'Carrier Names', value = namelist)
print('Sent!')
await ctx.send(embed=embed)
我认为这很有意义,
nameslist
变量是一个列表。你可以用str.join(list)
连接它,所以它是一个字符串相关问题 更多 >
编程相关推荐