Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MliKiowa committed Apr 28, 2024
1 parent 686a426 commit 5c6acbb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/onebot11/action/group/GetGroupNotice.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import { WebApi, WebApiGroupNoticeRet } from '@/core/apis/webapi';
import BaseAction from '../BaseAction';
import { ActionName } from '../types';

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;
}
}
2 changes: 2 additions & 0 deletions src/onebot11/action/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -90,6 +91,7 @@ export const actionHandlers = [
new SetOnlineStatus(),
new GetRobotUinRange(),
//以下为go-cqhttp api
new GetGroupNotice(),
new GoCQHTTPSendForwardMsg(),
new GoCQHTTPSendGroupForwardMsg(),
new GoCQHTTPSendPrivateForwardMsg(),
Expand Down

0 comments on commit 5c6acbb

Please sign in to comment.