请求测试通过

This commit is contained in:
目棃
2024-08-15 18:43:05 +08:00
parent 32fb6df2ac
commit 6e0bb42c3b
5 changed files with 87 additions and 15 deletions

View File

@@ -0,0 +1,25 @@
/**
* @file plugins/Sqlite/modules/userAvatar.ts
* @description 用户角色模块
* @since Beta v0.5.3
*/
import TGSqlite from "../index.js";
/**
* @description 获取用户角色id列表
* @since Beta v0.5.3
* @returns {Promise<string[]>} 角色id列表
*/
async function getAllAvatarId(): Promise<string[]> {
const db = await TGSqlite.getDB();
type resType = Array<{ cid: string }>;
const res = await db.select<resType>("SELECT DISTINCT cid FROM UserCharacters;");
return res.map((i) => i.cid);
}
const TSUserAvatar = {
getAllAvatarId,
};
export default TSUserAvatar;