import botpy
from botpy.message import Message
class MyClient(botpy.Client):
async def on_at_message_create(self, message: Message):
await self.api.get_guild_roles(guild_id="xxxx")
intents = botpy.Intents(public_guild_messages=True)
client = MyClient(intents=intents)
client.run(appid={appid}, token={token})
{
"guild_id":"guild_id",
"roles":[
{
"id":"4",
"name":"名称",
"color":4294927682,
"hoist":1,
"number":1,
"member_limit":1
},
{
"id":"2",
"name":"名称",
"color":4280276644,
"hoist":1,
"number":4,
"member_limit":50
}
],
"role_num_limit":"30"
}