使用命令提及用户

时间:2018-11-10 16:57:58

标签: python python-3.x discord discord.py

现在我正在执行一个名为!insult的随机命令来烘烤一个用@
标记的人 所以我的想法是在不和谐的聊天中写一条消息,例如
!insult @Diz,而漫游器会回复@Diz you're bad
随机分配“烧烤”效果很好,但是我被困在@部分以标记我想要的人。

如果有人可以帮助我并且知道解决方案,我将非常感激。

1 个答案:

答案 0 :(得分:0)

要标记用户,您可以使用discord.User.mention,就像在documentation中所说的那样
例如,您可以拥有类似的

@bot.command()
async def test(user:discord.User):
  await bot.say(f"{user.mention} you're bad")
相关问题