Merge remote-tracking branch 'origin/main'

This commit is contained in:
linyuchen
2024-04-28 20:39:33 +08:00
5 changed files with 18 additions and 10 deletions

View File

@@ -1,3 +1,4 @@
import { WebApi, WebApiGroupNoticeRet } from '@/core/apis/webapi';
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
@@ -5,12 +6,15 @@ interface PayloadType {
group_id: number
}
export class GetGroupNotice extends BaseAction<PayloadType, null> {
actionName = ActionName.GoCQHTTP_GetGroupNotice;
export class GetGroupNotice extends BaseAction<PayloadType, WebApiGroupNoticeRet> {
actionName = ActionName.GoCQHTTP_GetGroupNotice;
protected async _handle(payload: PayloadType) {
const group = payload.group_id.toString();
// WebApi.getGrouptNotice(group);
return null;
}
protected async _handle(payload: PayloadType) {
const group = payload.group_id.toString();
let ret = await WebApi.getGrouptNotice(group);
if (!ret) {
throw new Error('获取公告失败');
}
return ret;
}
}

View File

@@ -1,3 +1,4 @@
import { WebApi } from '@/core/apis/webapi';
import BaseAction from '../BaseAction';
import { ActionName } from '../types';
@@ -10,7 +11,7 @@ export class SetGroupNotice extends BaseAction<PayloadType, null> {
protected async _handle(payload: PayloadType) {
const group = payload.group_id.toString();
// WebApi.getGrouptNotice(group);
WebApi.setGroupNotice(group);
return null;
}
}

View File

@@ -49,6 +49,7 @@ import { GetCookies } from './user/GetCookies';
import { SetMsgEmojiLike } from '@/onebot11/action/msg/SetMsgEmojiLike';
import { GetRobotUinRange } from './extends/GetRobotUinRange';
import { SetOnlineStatus } from './extends/SetOnlineStatus';
import { GetGroupNotice } from './group/GetGroupNotice';
export const actionHandlers = [
new GetFile(),
@@ -90,6 +91,7 @@ export const actionHandlers = [
new SetOnlineStatus(),
new GetRobotUinRange(),
//以下为go-cqhttp api
new GetGroupNotice(),
new GoCQHTTPSendForwardMsg(),
new GoCQHTTPSendGroupForwardMsg(),
new GoCQHTTPSendPrivateForwardMsg(),