Revert "fix: 对齐 OneBot schema 与合并转发消息处理行为 (#1694)" (#1701)
Release NapCat / validate-version (push) Canceled after 0s
Release NapCat / Build-Framework (push) Canceled after 0s
Release NapCat / Build-Shell (push) Canceled after 0s
Release NapCat / Download-QNX64 (push) Canceled after 0s
Release NapCat / release-napcat (push) Canceled after 0s
Release NapCat / validate-version (push) Canceled after 0s
Release NapCat / Build-Framework (push) Canceled after 0s
Release NapCat / Build-Shell (push) Canceled after 0s
Release NapCat / Download-QNX64 (push) Canceled after 0s
Release NapCat / release-napcat (push) Canceled after 0s
This reverts commit deae7fd467.
This commit is contained in:
54 files changed
+195
-1078
No files matched your search
@@ -20,21 +20,13 @@ export default class SetGroupLeave extends OneBotAction<PayloadType, ReturnType>
|
||||
override payloadSchema = PayloadSchema;
|
||||
override returnSchema = ReturnSchema;
|
||||
override actionSummary = '退出群组';
|
||||
override actionDescription = '退出指定群聊;群主可通过 is_dismiss=true 解散群聊';
|
||||
override actionDescription = '退出或解散指定群聊';
|
||||
override actionTags = ['群组接口'];
|
||||
override payloadExample = GroupActionsExamples.SetGroupLeave.payload;
|
||||
override returnExample = GroupActionsExamples.SetGroupLeave.response;
|
||||
|
||||
async _handle (payload: PayloadType): Promise<null> {
|
||||
const isDismiss = typeof payload.is_dismiss === 'string'
|
||||
? payload.is_dismiss === 'true'
|
||||
: !!payload.is_dismiss;
|
||||
|
||||
if (isDismiss) {
|
||||
await this.core.apis.GroupApi.destroyGroup(payload.group_id.toString());
|
||||
} else {
|
||||
await this.core.apis.GroupApi.quitGroup(payload.group_id.toString());
|
||||
}
|
||||
await this.core.apis.GroupApi.quitGroup(payload.group_id.toString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user