chore: run eslint --fix in onebot module

This commit is contained in:
Wesley F. Young committed 2024-08-09 20:35:03 +08:00
1 parent f5b6fa31a7
commit af01a073ef
110 files changed
+3830 -3827

No files matched your search

@@ -4,27 +4,27 @@ import { NTQQSystemApi } from '@/core/apis';
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
const SchemaData = {
type: 'object',
properties: {
words: {
type: 'array',
items: { type: 'string' }
}
},
required: ['words'],
type: 'object',
properties: {
words: {
type: 'array',
items: { type: 'string' }
}
},
required: ['words'],
} as const satisfies JSONSchema;
type Payload = FromSchema<typeof SchemaData>;
export class TranslateEnWordToZn extends BaseAction<Payload, Array<any> | null> {
actionName = ActionName.TranslateEnWordToZn;
PayloadSchema = SchemaData;
protected async _handle(payload: Payload) {
const NTQQSystemApi = this.CoreContext.getApiContext().SystemApi;
const ret = await NTQQSystemApi.translateEnWordToZn(payload.words);
if (ret.result !== 0) {
throw new Error('翻译失败');
actionName = ActionName.TranslateEnWordToZn;
PayloadSchema = SchemaData;
protected async _handle(payload: Payload) {
const NTQQSystemApi = this.CoreContext.getApiContext().SystemApi;
const ret = await NTQQSystemApi.translateEnWordToZn(payload.words);
if (ret.result !== 0) {
throw new Error('翻译失败');
}
return ret.words;
}
return ret.words;
}
}