feat: implement get group notice

This commit is contained in:
H3CoF6 committed 2026-05-09 04:24:03 +08:00
1 parent 51c2fa285a
commit a0d584375a
6 files changed
+116 -3

No files matched your search

+14 -2
View File
@@ -261,8 +261,20 @@ export function register(h: ApiHandler, ctx: ApiActionContext): void {
}
});
h.registerAction('_get_group_notice', async () => {
return failedResponse(RETCODE.ACTION_FAILED, 'not yet implemented');
h.registerAction('_get_group_notice', async (params) => {
const groupId = asNumber(params.group_id);
if (!groupId) return failedResponse(RETCODE.BAD_REQUEST, 'group_id is required');
if (!ctx.getGroupNotice) {
return failedResponse(RETCODE.ACTION_FAILED, 'not implemented');
}
try {
const notices = await ctx.getGroupNotice(groupId);
return okResponse(notices);
} catch (e) {
return failedResponse(RETCODE.ACTION_FAILED, String(e));
}
});
h.registerAction('_del_group_notice', async () => {