问题
I want to put the avatar and nick of the person who ran a command in the embed, something like this:
requested by:
(avatar) (nick)
but I do not know how to start....
回答1:
sounds like you should read more documentation, here are a few links:
rewrite: embed, send
async: embed, send_message
otherwise here is the code that I recommend using
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)
回答2:
Theres a pretty handy tool online that you can use to create embeds using discord.py
.
Heres a link to it: Discord Embed Generator.
However, I highly suggest also reading the docs, to get a better understanding of what you're coding, instead of depending on that resource.
Heres the embed documentation.
回答3:
I used this:
embed.set_thumbnail(url=message.author.avatar_url)
embed.set_footer(text='ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤRequested by: ' + message.author.name)
来源:https://stackoverflow.com/questions/48412010/how-do-i-put-a-members-image-and-nick-on-embed-w-discord-py