mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-11 22:59:03 +08:00
25 lines
640 B
TypeScript
25 lines
640 B
TypeScript
import { getGroup } from '@/core/data';
|
|
import { OB11Group } from '../../types';
|
|
import { OB11Constructor } from '../../constructor';
|
|
import BaseAction from '../BaseAction';
|
|
import { ActionName } from '../types';
|
|
|
|
interface PayloadType {
|
|
group_id: number
|
|
}
|
|
|
|
class GetGroupInfo extends BaseAction<PayloadType, OB11Group> {
|
|
actionName = ActionName.GetGroupInfo;
|
|
|
|
protected async _handle(payload: PayloadType) {
|
|
const group = await getGroup(payload.group_id.toString());
|
|
if (group) {
|
|
return OB11Constructor.group(group);
|
|
} else {
|
|
throw `群${payload.group_id}不存在`;
|
|
}
|
|
}
|
|
}
|
|
|
|
export default GetGroupInfo;
|