NapCatQQ source snapshot
This commit is contained in:
commit
f954252a34
1111 files changed
+139867
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import type { GeneralCallResult } from 'napcat-core';
|
||||
|
||||
export function assertGroupManagementResults (
|
||||
operation: string,
|
||||
results: Array<{ setting: string, result: GeneralCallResult; }>
|
||||
): void {
|
||||
const failure = results.find(item => item.result.result !== 0);
|
||||
if (!failure) return;
|
||||
throw new Error(
|
||||
`${operation}失败 Setting: ${failure.setting} ErrCode: ${failure.result.result} ` +
|
||||
`ErrMsg: ${failure.result.errMsg || '未知错误'}`
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user