koishi-plugin-beatsaber-bot
Version:
一个 用于 BeatSaber 的 koishi Bot 插件
19 lines (18 loc) • 812 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getUserBSAccountInfo = void 0;
const koishi_1 = require("koishi");
async function getUserBSAccountInfo(ctx, userid) {
const accounts = await ctx.database.get('BSRelateOAuthAccount', (row) => {
return koishi_1.$.and(koishi_1.$.eq(row.uid, userid), koishi_1.$.or(koishi_1.$.eq(row.platform, 'scoresaber'), koishi_1.$.eq(row.platform, 'beatleader')));
});
const blAccount = accounts.find(it => it.platform == 'beatleader');
const ssAccount = accounts.find(it => it.platform == 'scoresaber');
const bsAccount = accounts.find(it => it.platform == 'beatsaver');
return {
blAccount: blAccount,
ssAccount,
bsAccount,
};
}
exports.getUserBSAccountInfo = getUserBSAccountInfo;