-3

这是我第一次在 Discord 上制作机器人,我想在我的频道上标记一个成员,并在其中添加一条消息。我的代码是这样的:

@client.event
async def on_message(message):
    if message.author == client.user:
        return

    if message.content.startswith('|bro'):
        await message.channel.send("You are dumb" + the member)

消息应该是这样的:"You are dumb @themember"

4

1 回答 1

1

如果您想 ping 作者,只需message.author.mention在您的回复中包含。

“.mention”会 ping 用户,就像您使用 @ 符号一样。

于 2021-10-25T07:11:27.057 回答