获取精华消息

用于获取子频道 channelId 内的精华消息。

使用示例

import botpy

from botpy.message import Message

class MyClient(botpy.Client):
    async def on_at_message_create(self, message: Message):
        await self.api.get_pins(channel_id=message.channel_id)

intents = botpy.Intents(public_guild_messages=True)
client = MyClient(intents=intents)
client.run(appid={appid}, token={token})

参数说明

字段名必填类型描述
channel_idstring子频道 ID

返回说明

返回 PinsMessage 对象。

PinsMessage

字段名类型描述
guild_idstring频道 ID
channel_idstring子频道 ID
message_idsstring[]消息 ID

返回示例

data

{
  "guild_id": "xxxxxx",
  "channel_id": "xxxxxx",
  "message_ids": ["xxxxx"]
}