我如何将会员的图片和昵称嵌入? (带 discord.py)
How do I put a member's image and nick on embed? (w/ discord.py)
我想把运行命令的人的头像和昵称放到嵌入里,像这样:
requested by:
(avatar) (nick)
但我不知道如何开始....
有一个非常方便的在线工具,您可以使用它来创建使用 discord.py
的嵌入。
这是一个 link:Discord Embed Generator。
但是,我强烈建议您也阅读文档,以更好地理解您正在编码的内容,而不是依赖于该资源。
这是嵌入 documentation。
听起来您应该阅读更多文档,这里有一些链接:
异步:embed, send_message
否则这是我推荐使用的代码
em = discord.Embed(description='requested by:\n{0}'.format(ctx.author))
em.set_thumbnail(url=ctx.author.avatar_url)
# for rewrite (1.0.0a) do
await ctx.send(embed=em)
# if you're using async 0.16.x do
await bot.say(embed=em)
我用过这个:
embed.set_thumbnail(url=message.author.avatar_url)
embed.set_footer(text='ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤRequested by: ' + message.author.name)
我想把运行命令的人的头像和昵称放到嵌入里,像这样:
requested by:
(avatar) (nick)
但我不知道如何开始....
有一个非常方便的在线工具,您可以使用它来创建使用 discord.py
的嵌入。
这是一个 link:Discord Embed Generator。
但是,我强烈建议您也阅读文档,以更好地理解您正在编码的内容,而不是依赖于该资源。
这是嵌入 documentation。
听起来您应该阅读更多文档,这里有一些链接:
异步:embed, send_message
否则这是我推荐使用的代码
em = discord.Embed(description='requested by:\n{0}'.format(ctx.author))
em.set_thumbnail(url=ctx.author.avatar_url)
# for rewrite (1.0.0a) do
await ctx.send(embed=em)
# if you're using async 0.16.x do
await bot.say(embed=em)
我用过这个:
embed.set_thumbnail(url=message.author.avatar_url)
embed.set_footer(text='ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤRequested by: ' + message.author.name)