@bee.command(name="돈얼마", description="지갑 지갑을 보자!")
async def 돈얼마(interaction: discord.Interaction, 멘션: discord.User):
userid = 멘션.id
embed=discord.Embed(title="돈 지급", description=f"잔액 : {money[userid]}원\n" + f"이정도 밖에 없는건 아니죠? 에이", color=0x5cff67)
await interaction.response.send_message(embed=embed)
这段代码,我想让这部分成为一个可选参数>“:用户”
我不知道请帮帮我
1条答案
按热度按时间pvcm50d11#
检查此:https://www.w3schools.com/python/gloss_python_function_default_parameter.asp
您也可以使用
None
作为默认参数,并以其他方式处理它:当给出时,它将像往常一样执行,否则将执行
foo()
。