【发布时间】:2021-11-24 15:29:00
【问题描述】:
我正在用 Python 制作一个不和谐的机器人,我想在使用命令 ]kill 时发送一个嵌入。所以当我标记某人并使用该命令时,输出不是成员名字。
我需要将其设为标记用户的名称。
这是我的代码。
killgifs = ['https://c.tenor.com/1dtHuFICZF4AAAAC/kill-smack.gif' , 'https://c.tenor.com/gQAWuiZnbZ4AAAAC/pokemon-anime.gif' , 'https://c.tenor.com/PJbU0yjG3BUAAAAd/anime-girl.gif' , 'https://c.tenor.com/Re9dglY0sCwAAAAC/anime-wasted.gif']
@bot.command(name='kill')
async def kill (ctx,person) :
author = ctx.author
embed = discord.Embed (color=discord.Color.red())
embed.set_author(name=f'{author} kills {person}')
embed.set_image(url = (random.choice(killgifs)))
await ctx.send(embed=embed)
【问题讨论】:
标签: python discord.py mention