【发布时间】:2022-01-11 03:01:13
【问题描述】:
我一直在寻找适用于我的代码的答案,但老实说我找不到。我知道如何创建按钮并将它们添加到嵌入的底部,但我无法让它们发送隐藏消息。这是我的按钮代码:
buttons = [
create_button(style=ButtonStyle.green, label="I liked it"),
create_button(style=ButtonStyle.grey, label="I'm neutral"),
create_button(style=ButtonStyle.red, label="I did not like it")
]
action_row = create_actionrow(*buttons)
bcc2 = await bcc.send(embed=embed, components=[action_row])
它是在一天的特定时间发生的重复功能。但是,当我尝试链接响应时,它会完全忽略它。有什么建议吗?这是我的回复尝试:
@slash.component_callback()
async def hello(ctx: ComponentContext):
await ctx.send(content="You pressed a button!", hidden=True)
最后我希望发送的消息是隐藏消息。
【问题讨论】:
-
您使用什么软件包来制作按钮和执行斜线命令?据我所知,
discord.py无法发送隐藏消息。但有些包提供了一种发送“临时消息”作为对斜杠命令和其他组件的响应的方法。
标签: python discord discord.py