mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
feat: new Api GetGroupEssence&GetGroupHonorInfo
This commit is contained in:
20
src/onebot11/action/group/GetGroupEssence.ts
Normal file
20
src/onebot11/action/group/GetGroupEssence.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { GroupEssenceMsgRet, WebApi } from "@/ntqqapi/api";
|
||||
import BaseAction from "../BaseAction";
|
||||
import { ActionName } from "../types";
|
||||
|
||||
interface PayloadType {
|
||||
group_id: number;
|
||||
pages: number;
|
||||
}
|
||||
|
||||
export class GetGroupEssence extends BaseAction<PayloadType, GroupEssenceMsgRet> {
|
||||
actionName = ActionName.GoCQHTTP_GetEssenceMsg;
|
||||
|
||||
protected async _handle(payload: PayloadType) {
|
||||
const ret = await WebApi.getGroupEssenceMsg(payload.group_id.toString(), payload.pages.toString());
|
||||
if (!ret) {
|
||||
throw new Error('获取失败');
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user