我的不和谐机器人应该在包含 GIF 的嵌入中标记人员。我使用以下代码来提及:
embed = discord.Embed(title = f"{member.mention}, I'm sorry...")
但是,我没有标记成员,而是获取 ID:截屏 https://i.stack.imgur.com/GtXPu.png
Alkes02 的答案不正确。
您可以在嵌入中标记(他们不会收到通知)人员。
请参阅我的机器人的下图:https://gyazo.com/118f0251798afd32bdd23d806c694544 https://gyazo.com/118f0251798afd32bdd23d806c694544
我相信您只需获取消息的作者并添加.mention
到对象的末尾。
for user in board:
description += f"**{board.index(user) + 1}.** {user[0].mention} | Level: {user[1]} |
XP: {user[2]}\n"
msg = discord.Embed(
color=discord.Color.green(),
title=f"{str(ctx.guild)}" "s Valley Leaderboard",
description=description,
)
await ctx.send(embed=msg)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)