因此,我在discord.py中创建了一个bot命令,用户输入该命令,然后给它一些输入,然后代码将输入放到一个嵌入式中并发送它.我希望有一种方法能够将结果发送到发送命令的同一通道. 我读过有关发送消息的文章,但很多人说需要有通道ID才能发送消息,但我希望它将消息发送到运行该命令的同一通道. 你能帮我解决这个问题吗?
EDIT个 代码如下:
@bot.command(name="fban")
async def fban(ctx):
# This will make sure that the response will
# only be registered if the following
# conditions are met:
def check(msg):
return msg.author == ctx.author and msg.channel == ctx.channel
msg = await bot.wait_for("message", check=check)
outmsg = msg.content.lower()
username = outmsg.splitlines()[0]
reason = outmsg.splitlines()[1]
fake_ban_embed = discord.Embed(title="{username} was
banned.",description="Reason : {reason}")
fake_ban_embed.set_thumbnail(url='https://imgur.com/FkqtqE8')
await message.reply(embed=fake_ban_embed)