add roles

This commit is contained in:
2022-06-07 16:24:16 +08:00
parent 26a4c93ee1
commit e502f72858
4 changed files with 583 additions and 473 deletions

View File

@@ -10,4 +10,22 @@ export async function getRole(guildId) {
console.log("缓存命中")
return myCache.get("roleList")
}
}
}
export async function getGuild(name){
let { data } = await client.meApi.meGuilds();
// return data.forEach((item)=>{
// // return
// if(item.name == name){
// return item.id
// }
// })
for(const i of data){
if(i.name == name){
return i.id
}
}
}