discord - 从 exc,discord.py 中引发 CommandInvokeError(exc)
问题描述
我是蟒蛇的新手!错误总结: CommandInvokeError(exc) from exc
,ctx.command.invoke(ctx)
这是我的代码。
@client.command(pass_context=True)
async def serverinfo(ctx):
embed = discord.Embed(name="{}'s info".format(ctx.message.guild.name), color=0x176cd5)
embed.add_field(name="guild Name", value=ctx.message.guild.name, inline=True)
embed.add_field(name="Roles", value=len(ctx.message.guild.roles), inline=True)
embed.add_field(name="Members", value=len(ctx.message.guild.members))
embed.add_field(name="Channels", value=len(ctx.message.guild.channels))
embed.add_field(name="Region", value=ctx.message.guild.region)
embed.add_field(name="Verification Level", value=ctx.message.guild.verification_level)
embed.add_field(name="Owner", value=ctx.message.guild.owner.mention)
embed.add_field(name="Emojis", value=len(ctx.message.guild.emojis))
embed.set_thumbnail(url=ctx.message.guild.icon_url)
embed.set_thumbnail(url=ctx.message.guild.icon_url)
embed.set_author(name=ctx.message.guild.name, icon_url=ctx.message.guild.icon_url)
embed.set_footer(text="Server ID is " + ctx.message.guild.id)
await ctx.send(embed=embed)
错误 :-
File "C:\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
你能帮我解决这个问题吗?谢谢!
解决方案
我想你已经添加了embed.set_thumbnail(url=ctx.message.guild.icon_url)
2 次删除一个,然后再试一次
推荐阅读
- javascript - Cloudsponge 异步 javascript
- c# - SignalR 在 3 分钟后断开连接,并在断开连接后重新连接,该过程再次从零点开始
- java - Kafka - 在 Windows IOException 上创建生产者
- jquery - 当一行中的所有内容都填满时,使输入字段变为绿色
- r - 删除每组的连续/连续初始 NA 值
- java - 用于 Java 应用程序的 Zipkin
- testing - saltstack测试:依次渲染为每个主机
- php - Laravel 配置文件结构
- sql - oracle SQL插入中的列不允许此处错误
- blockchain - 模块化智能合约