我如何使用hikari使用命令在不同的频道中在不同的频道中说出一条消息

发布于 2025-02-11 13:38:21 字数 75 浏览 1 评论 0原文

我正在尝试使我的hikari bot使用命令说我在命令中输入的消息到另一个/不同的频道。基本上,我想让机器人在另一个频道中说出我的消息。

I am trying to make my Hikari bot use commands to say the message I input in the command to another/diferent channel. Basically, I want to make the bot say my messages in another channel.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

裂开嘴轻声笑有多痛 2025-02-18 13:38:22

只要您要将消息发送到频道的ID,就可以使用 create_message bot的方法impl/rest.html#hikari.impl.rest.restclientimpl“ rel =” nofollow noreferrer“> retclientimpl 实例:

例如:

await bot.rest.create_message(channel_id, "foo")

上面的消息将发送带有content foo foo的消息带有给定channel_id的通道。

As long as you have the ID of the channel you would like to send the message to, you can use the create_message method of the bot's RestClientImpl instance:

For Example:

await bot.rest.create_message(channel_id, "foo")

The above would send a message with content foo to the channel with the given channel_id.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文