chore: config

This commit is contained in:
手瓜一十雪
2024-08-09 22:29:01 +08:00
parent cd57e24a79
commit a495e5de4f
2 changed files with 48 additions and 81 deletions

View File

@@ -1,75 +1,40 @@
import fs from 'node:fs';
import path from 'node:path';
import { ConfigBase } from '@/common/utils/ConfigBase';
// export interface OB11Config {
// http: {
// enable: boolean;
// host: string;
// port: number;
// secret: string;
// enableHeart: boolean;
// enablePost: boolean;
// postUrls: string[];
// };
// ws: {
// enable: boolean;
// host: string;
// port: number;
// };
// reverseWs: {
// enable: boolean;
// urls: string[];
// };
export interface OB11Config {
http: {
enable: boolean;
host: string;
port: number;
secret: string;
enableHeart: boolean;
enablePost: boolean;
postUrls: string[];
};
ws: {
enable: boolean;
host: string;
port: number;
};
reverseWs: {
enable: boolean;
urls: string[];
};
// debug: boolean;
// heartInterval: number;
// messagePostFormat: 'array' | 'string';
// enableLocalFile2Url: boolean;
// musicSignUrl: string;
// reportSelfMessage: boolean;
// token: string;
// GroupLocalTime: {
// Record: boolean,
// RecordList: Array<string>
// },
// read(): OB11Config;
// save(config: OB11Config): void;
// }
debug: boolean;
heartInterval: number;
messagePostFormat: 'array' | 'string';
enableLocalFile2Url: boolean;
musicSignUrl: string;
reportSelfMessage: boolean;
token: string;
GroupLocalTime: {
Record: boolean,
RecordList: Array<string>
}
}
export class OB11Config extends ConfigBase<OB11Config> {
name: string = 'onebot11';
http = {
enable: false,
host: '',
port: 3000,
secret: '',
enableHeart: false,
enablePost: false,
postUrls: [],
};
ws = {
enable: false,
host: '',
port: 3001,
};
reverseWs = {
enable: false,
urls: [],
};
debug = false;
heartInterval = 30000;
messagePostFormat: 'array' | 'string' = 'array';
enableLocalFile2Url = true;
musicSignUrl = '';
reportSelfMessage = false;
token = '';
GroupLocalTime = {
Record: false,
RecordList: [] as Array<string>
};
name = 'onebot11';
protected getKeys(): string[] | null {
return null;
}