mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix: #1049
This commit is contained in:
27
src/onebot/action/group/GetGroupDetailInfo.ts
Normal file
27
src/onebot/action/group/GetGroupDetailInfo.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
|
import { ActionName } from '@/onebot/action/router';
|
||||||
|
import { Static, Type } from '@sinclair/typebox';
|
||||||
|
|
||||||
|
const SchemaData = Type.Object({
|
||||||
|
group_id: Type.Union([Type.Number(), Type.String()]),
|
||||||
|
});
|
||||||
|
|
||||||
|
type Payload = Static<typeof SchemaData>;
|
||||||
|
|
||||||
|
export class GetGroupDetailInfo extends OneBotAction<Payload, unknown> {
|
||||||
|
override actionName = ActionName.GetGroupDetailInfo;
|
||||||
|
override payloadSchema = SchemaData;
|
||||||
|
|
||||||
|
async _handle(payload: Payload) {
|
||||||
|
const data = await this.core.apis.GroupApi.fetchGroupDetail(payload.group_id.toString());
|
||||||
|
return {
|
||||||
|
...data,
|
||||||
|
group_all_shut: data.shutUpAllTimestamp > 0 ? -1 : 0,
|
||||||
|
group_remark: '',
|
||||||
|
group_id: +payload.group_id,
|
||||||
|
group_name: data.groupName,
|
||||||
|
member_count: data.memberNum,
|
||||||
|
max_member_count: data.maxMemberNum,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@@ -120,10 +120,12 @@ import SetGroupAddOption from './extends/SetGroupAddOption';
|
|||||||
import SetGroupSearch from './extends/SetGroupSearch';
|
import SetGroupSearch from './extends/SetGroupSearch';
|
||||||
import SetGroupRobotAddOption from './extends/SetGroupRobotAddOption';
|
import SetGroupRobotAddOption from './extends/SetGroupRobotAddOption';
|
||||||
import SetGroupKickMembers from './extends/SetGroupKickMembers';
|
import SetGroupKickMembers from './extends/SetGroupKickMembers';
|
||||||
|
import { GetGroupDetailInfo } from './group/GetGroupDetailInfo';
|
||||||
|
|
||||||
export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
|
export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
|
||||||
|
|
||||||
const actionHandlers = [
|
const actionHandlers = [
|
||||||
|
new GetGroupDetailInfo(obContext, core),
|
||||||
new SetGroupKickMembers(obContext, core),
|
new SetGroupKickMembers(obContext, core),
|
||||||
new SetGroupAddOption(obContext, core),
|
new SetGroupAddOption(obContext, core),
|
||||||
new SetGroupRobotAddOption(obContext, core),
|
new SetGroupRobotAddOption(obContext, core),
|
||||||
|
@@ -132,6 +132,7 @@ export const ActionName = {
|
|||||||
FetchEmojiLike: 'fetch_emoji_like',
|
FetchEmojiLike: 'fetch_emoji_like',
|
||||||
SetInputStatus: 'set_input_status',
|
SetInputStatus: 'set_input_status',
|
||||||
GetGroupInfoEx: 'get_group_info_ex',
|
GetGroupInfoEx: 'get_group_info_ex',
|
||||||
|
GetGroupDetailInfo: 'get_group_detail_info',
|
||||||
GetGroupIgnoreAddRequest: 'get_group_ignore_add_request',
|
GetGroupIgnoreAddRequest: 'get_group_ignore_add_request',
|
||||||
DelGroupNotice: '_del_group_notice',
|
DelGroupNotice: '_del_group_notice',
|
||||||
FriendPoke: 'friend_poke',
|
FriendPoke: 'friend_poke',
|
||||||
|
Reference in New Issue
Block a user