refactor: auto judge client

This commit is contained in:
pk5ls20 committed 2024-11-05 14:24:54 +08:00
1 parent 017b8b7f15
commit ad6f21980c
4 files changed
+35 -49

No files matched your search

+3 -9
View File
@@ -30,10 +30,6 @@ export abstract class PacketClient {
this.config = core.configLoader.configData;
}
get available(): boolean {
return this.isAvailable;
}
private randText(len: number): string {
let text = '';
const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
@@ -43,13 +39,11 @@ export abstract class PacketClient {
return text;
}
static create(core: NapCatCore): PacketClient {
throw new Error("Must be implemented by subclasses");
get available(): boolean {
return this.isAvailable;
}
static compatibilityScore(logger: LogWrapper): number {
throw new Error("Must be implemented by subclasses");
}
abstract check(core: NapCatCore): boolean;
abstract init(pid: number, recv: string, send: string): Promise<void>;