【发布时间】:2022-01-17 09:28:46
【问题描述】:
@client.command()
async def server(ctx):
embed = discord.Embed(title = f"{ctx.guild.name} Info", description = "Information of this Server", color = discord.Colour.blue())
embed.add_field(name = '????Server ID', value = f"{ctx.guild.id}", inline = True)
embed.add_field(name = '????Created On', value = ctx.guild.created_at.strftime("%b %d %Y"), inline = True)
embed.add_field(name = '????Owner', value = f"{ctx.guild.owner}", inline = True)
embed.add_field(name = '????Members', value = f'{ctx.guild.member_count} Members', inline = True)
embed.add_field(name = '????Channels', value = f'{ctx.guild.text_channel_count} Text | {ctx.guild.voice_channel_count} Voice', inline = True)
embed.add_field(name = '????Region', value = f'{ctx.guild.region}', inline = True)
embed.set_thumbnail(url = ctx.guild.icon_url)
embed.set_footer(text = "⭐ • Duo")
embed.set_author(name = f'{ctx.guild.name}', url = embed.Empty, icon_url = {ctx.guild.icon_url})
await ctx.send(embed=embed)
我写了这段代码,一切看起来都很好,当我运行机器人时,没有错误。终端是空白的,但是当我运行这个命令时,它不起作用,它没有发送响应,终端也没有错误。请帮忙..
【问题讨论】:
-
使用
print语句查看机器人卡在哪里。我也没听说过embed.Empty,这是什么?
标签: python discord discord.py