【发布时间】:2021-04-30 09:25:06
【问题描述】:
我的代码中有一个看起来像这样的变量,唯一的问题是它在我的终端中看起来很丑。这是一张图片。
我希望它显示:{获胜者姓名}赢得了:{prize},而不是显示他们的 Discord ID 并让我的终端看起来很难看。
这是我的代码,它使这个终端成为怪物。
winners = random.sample([user for user in users if not user.bot], k=winerscount)
winnerstosend = "\n".join([winner.mention for winner in winners])
win = await msg.edit(embed = discord.Embed(title = "WINNER" , description = f"Congratulations {winnerstosend}, you have won **{msg4.content}**!" , color = discord.Color.blue()))
print(Fore.GREEN + winnerstosend , Fore.WHITE + "has won: " , Fore.GREEN + msg4.content)
print(Style.RESET_ALL)
现在,如果您能帮助我,并将我的错误转化为漂亮的确认信息,我会很高兴的。
【问题讨论】:
标签: python python-3.x discord bots discord.py