import os
import botpy
from botpy import logging
from botpy.message import Message
_log = logging.get_logger()
class MyClient(botpy.Client):
async def on_at_message_create(self, message: Message):
apis = await self.api.get_permissions(message.guild_id)
for api in apis:
_log.info("api: %s" % api["desc"] + ", status: %d" % api["auth_status"])
intents = botpy.Intents(public_guild_messages=True)
client = MyClient(intents=intents)
client.run(appid={appid}, token={token})
{
"apis": [
{
"path": "/guilds/{guild_id}/members/{user_id}",
"method": "GET",
"desc": "获取当前频道成员信息",
"auth_status": 0
},
{
"path": "/channels/{channel_id}/messages",
"method": "POST",
"desc": "创建消息",
"auth_status": 1
}
]
}