qqbot/bin/channel-core/tools.js

13 lines
367 B
JavaScript
Raw Normal View History

2022-06-03 13:57:28 +00:00
import { myCache } from "../cache/index.js";
2022-06-02 07:45:35 +00:00
import { client } from "./base.js";
2022-06-03 13:57:28 +00:00
export async function getRole(guildId) {
if(!myCache.get("roleList")){
let { data } = await client.roleApi.roles(guildId);
myCache.set("roleList",data)
return data
}else{
console.log("缓存命中")
return myCache.get("roleList")
}
2022-06-02 07:45:35 +00:00
}