refactor: move web action into web-actions from bridge-actions

This commit is contained in:
H3CoF6 committed 2026-05-09 04:08:52 +08:00
1 parent c862a157db
commit 51c2fa285a
4 files changed
+231 -215

No files matched your search

+7 -2
View File
@@ -230,20 +230,25 @@ export function register(h: ApiHandler, ctx: ApiActionContext): void {
// --- Group notice stubs ---
h.registerAction('send_group_notice', async (params) => {
h.registerAction('_send_group_notice', async (params) => {
const groupId = asNumber(params.group_id);
const content = asString(params.content);
const image = asString(params.image);
if (!groupId || !content) {
return failedResponse(RETCODE.BAD_REQUEST, 'group_id and content are required');
}
if (image) {
return failedResponse(RETCODE.ACTION_FAILED, 'not implemented: image upload for group notice is not supported yet');
}
if (!ctx.sendGroupNotice) {
return failedResponse(RETCODE.ACTION_FAILED, 'not implemented');
}
try {
const options = {
image: asString(params.image),
pinned: params.pinned !== undefined ? Number(params.pinned) : 0,
type: params.type !== undefined ? Number(params.type) : 1,
confirm_required: params.confirm_required !== undefined ? Number(params.confirm_required) : 1,