【发布时间】:2021-10-16 09:54:52
【问题描述】:
如何从用户字符串列表中添加@提及?我想通知那些选定的用户。
sample_text: @user#tag
这将是纯文本,无法提及。尝试遍历成员并将其保存为对象,但只返回机器人。
示例代码:
async def on_message(self, message):
(...)
embed = discord.Embed(title=c.LFG_OVER, description="Party:", color=c.COLOUR_BANANA)
embed.set_author(name=f"{message.author.display_name}", url="", icon_url=f"{message.author.avatar_url}")
embed.set_thumbnail(url=c.LFG_TY)
embed.add_field(name="_", value=f"This is text: {list1[0]}\nThis is text: {list1[1]}\nThis is text: {list2[0]}\nThis is text: {list2[1]}", inline=True)
embed.add_field(name="_", value=f"This is text: {list3[0]}\nThis is text: {dps[1]}\nThis is text: {list3[2]}\nThis is text: {list3[3]}", inline=True)
await message.channel.send(embed=embed)
【问题讨论】:
-
您需要他们的用户 ID。
标签: python discord.py