@hieuzest/koishi-plugin-mahjongpub 0.1.16 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +20 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -356,7 +356,7 @@ class MahjongPub {
|
|
|
356
356
|
.option('rowi', '-i <rowi:integer>', { fallback: 9 })
|
|
357
357
|
.option('ver', '-v <ver:integer>', { fallback: 0 })
|
|
358
358
|
.channelFields(['mahjongpub/bind-contest'])
|
|
359
|
-
.action(async ({ session, options }, round, cls
|
|
359
|
+
.action(async ({ session, options }, round, cls) => {
|
|
360
360
|
const [cid] = [session.channel['mahjongpub/bind-contest']];
|
|
361
361
|
try {
|
|
362
362
|
const record = await ctx.mahjong.database.db('scoreboard').collection('matches').findOne({
|
|
@@ -398,6 +398,25 @@ class MahjongPub {
|
|
|
398
398
|
return session.text('.failed');
|
|
399
399
|
}
|
|
400
400
|
});
|
|
401
|
+
ctx.command('mahjongpub.admin.record.get <round:natural> <cls:natural>', { authority: 3 })
|
|
402
|
+
.option('rowi', '-i <rowi:integer>', { fallback: 9 })
|
|
403
|
+
.option('ver', '-v <ver:integer>', { fallback: 0 })
|
|
404
|
+
.action(async ({ session, options }, round, cls) => {
|
|
405
|
+
const msg = [];
|
|
406
|
+
msg.push('- Mahjongpub');
|
|
407
|
+
msg.push(await session.execute({
|
|
408
|
+
name: 'mahjongpub.contest.record.get',
|
|
409
|
+
args: [round, cls],
|
|
410
|
+
options,
|
|
411
|
+
}, true));
|
|
412
|
+
msg.push('- Database');
|
|
413
|
+
msg.push(await session.execute({
|
|
414
|
+
name: 'mahjongpub.database.record.get',
|
|
415
|
+
args: [round, cls],
|
|
416
|
+
options,
|
|
417
|
+
}, true));
|
|
418
|
+
return msg.join('\n');
|
|
419
|
+
});
|
|
401
420
|
}
|
|
402
421
|
}
|
|
403
422
|
async getTeam(pw) {
|