【发布时间】:2021-08-09 18:46:17
【问题描述】:
我正在为我的机器人创建 Embed cmd,我希望我的机器人询问用户想要发送嵌入的频道,但在执行此操作时遇到了错误。
代码:
@bot.command()
async def buildembed(ctx):
def check(message):
return message.author == ctx.author and message.channel == ctx.channel
await ctx.send('Waiting for a title')
title = await bot.wait_for('message', check=check)
await ctx.send('Waiting for a description')
desc = await bot.wait_for('message', check=check)
await ctx.send('Channel ID')
guild = bot.get_guild(12345678)
channel = guild.get_channel(await bot.wait_for('message', check=check))
embed = discord.Embed(title=title.content, description=desc.content, color=discord.Color.blue())
await channel.send(embed=embed)
raise CommandInvokeError(exc) from exc discord.ext.commands.errors.CommandInvokeError: Command raised an异常:AttributeError:“NoneType”对象没有“发送”属性
非常感谢您的帮助
【问题讨论】:
标签: python discord discord.py embed