mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
commit
df5968ccc1
@ -1,5 +1,5 @@
|
|||||||
import { OB11Group } from '../types';
|
import { OB11Group } from '../types';
|
||||||
import { getGroup, groups } from "../../common/data";
|
import { getGroup } from "../../common/data";
|
||||||
import { OB11Constructor } from "../constructor";
|
import { OB11Constructor } from "../constructor";
|
||||||
import BaseAction from "./BaseAction";
|
import BaseAction from "./BaseAction";
|
||||||
import { ActionName } from "./types";
|
import { ActionName } from "./types";
|
||||||
@ -8,17 +8,17 @@ interface PayloadType {
|
|||||||
group_id: number
|
group_id: number
|
||||||
}
|
}
|
||||||
|
|
||||||
class GetGroupInfo extends BaseAction<PayloadType, OB11Group[]> {
|
class GetGroupInfo extends BaseAction<PayloadType, OB11Group> {
|
||||||
actionName = ActionName.GetGroupInfo
|
actionName = ActionName.GetGroupInfo
|
||||||
|
|
||||||
protected async _handle(payload: PayloadType) {
|
protected async _handle(payload: PayloadType) {
|
||||||
const group = await getGroup(payload.group_id.toString())
|
const group = await getGroup(payload.group_id.toString())
|
||||||
if (group) {
|
if (group) {
|
||||||
return OB11Constructor.groups(groups)
|
return OB11Constructor.group(group)
|
||||||
} else {
|
} else {
|
||||||
throw `群${payload.group_id}不存在`
|
throw `群${payload.group_id}不存在`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default GetGroupInfo
|
export default GetGroupInfo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user