发送私信消息 |
您所在的位置:网站首页 › 电脑版qq如何禁言某个人 › 发送私信消息 |
# 发送私信消息 用于发送私信消息,前提是已经创建了私信会话。 # 功能描述 私信的 guild_id 在创建私信会话时以及私信消息事件中获取。 私信场景下,每个机器人每天可以对一个用户发 2 条主动消息。 私信场景下,每个机器人每天累计可以发 200 条主动消息。 私信场景下,被动消息没有条数限制。 # 使用示例 import botpy from botpy.message import Message class MyClient(botpy.Client): async def on_at_message_create(self, message: Message): await self.api.post_dms(guild_id="xxxx", content="xx") intents = botpy.Intents(public_guild_messages=True) client = MyClient(intents=intents) client.run(appid={appid}, token={token}) 12345678910# 参数说明 字段名 必填 类型 描述 guild_id 是 string 私信频道 ID msg_request 是 MessageSendRequest 消息体 ,参考发送消息 # 返回说明同发送消息返回说明,返回Message 对象。 # 返回示例参考发送消息返回示例。 在GitHub上编辑此页 (opens new window) 上次更新: 6/24/2022, 6:27:11 PM← 创建私信会话 发表表情表态 → 贡献者🎉 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |