Discord.py,在服务器中发送直接消息

问题描述 投票:0回答:1

如何在服务器中发送一条只有运行命令的玩家才能看到的消息?

@bot.command(description="says hello... yeah") async def hello(ctx): await ctx.send(f"hello {ctx.author.mention}!!!", ephemeral=True)

我尝试使用短暂的,但它不起作用

python discord discord.py
1个回答
0
投票

短暂性仅适用于交互,即斜杠命令响应、按钮/选择、模态响应等。如果您需要该功能,则需要使用斜杠命令,或者您可以在 DM 中发送消息。

© www.soinside.com 2019 - 2024. All rights reserved.