为了账号安全,请及时绑定邮箱和手机立即绑定

错误:MissingPermissions 类型的对象不可 JSON 序列化

错误:MissingPermissions 类型的对象不可 JSON 序列化

Qyouu 2023-10-06 16:43:18
@client.eventasync def on_command_error(ctx, error):    embed = discord.Embed(colour=maincolour)    embed.title = "**Error**"    embed.description = error    await ctx.send(embed=embed)当我运行并放置一个带有错误或其他内容的命令时,我希望它发回嵌入,但日志中显示的所有内容是上面脚本的最后一行中MissingPermissions 类型的对象不可 JSON 序列化。请问有人可以帮忙吗?
查看完整描述

1 回答

?
慕标琳琳

TA贡献1830条经验 获得超9个赞

替换embed.description = errorembed.description = str(error) (type(error)如果您想更好地理解,请打印)



查看完整回答
反对 回复 2023-10-06
  • 1 回答
  • 0 关注
  • 61 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信