【发布时间】:2020-10-07 20:31:56
【问题描述】:
当我使用 dailygacha 命令时,以下代码不会在我的服务器中发送嵌入的消息。但是,所有其他命令都可以正常工作。任何我可以阅读的文档链接也将不胜感激,因此我可以进一步了解您的任何解决方案是如何工作的。提前谢谢你。
α = 75,67,70
β = 90,95,78
γ = 86,18,10
δ = 9,56,93
ε = 117, 85, 138
ζ = 232, 99, 202
rarity = random.choices("αβγδεζ", weights=[60, 40, 20, 15, 5, 3])
strength = random.randint(0, 100)
agility = random.randint(0, 100)
defense = random.randint(0, 100)
endurance = random.randint(0, 100)
csi = ((strength + agility + defense + endurance) / 4)
@bot.command()
@commands.cooldown(1, 60*60*24, commands.BucketType.user)
async def dailygacha(ctx):
embed = discord.Embed(
colour = discord.Colour.to_rgb(rarity),
title = "Waifu Gacha",
description = f"Roll Result: Lelouch Lamperouge [{rarity}]",
)
embed.set_image(url="https://cdn.myanimelist.net/images/characters/5/274017.jpg")
embed.add_field(name="Character Stats:", inline=False)
embed.add_field(name=f"Strength: {strength}", inline=False)
embed.add_field(name=f"Agility: {agility}", inline=False)
embed.add_field(name=f"Defense: {defense}", inline=False)
embed.add_field(name=f"Endurance: {endurance}", inline=False)
embed.add_field(name=f"Total CSI: {csi}", inline=False)
embed.add_field(name="Roll Type:", inline=False)
embed.add_field(name="Daily", inline=False)
await ctx.send(embed=embed)
【问题讨论】:
标签: python python-3.x discord discord.py discord.py-rewrite