Remove override of UserConfig
This commit is contained in:
parent
d58fb84565
commit
320075e376
@ -78,6 +78,7 @@ export type UserConfig = {
|
|||||||
hostname?: string;
|
hostname?: string;
|
||||||
isSecure?: boolean;
|
isSecure?: boolean;
|
||||||
};
|
};
|
||||||
|
networks?: NetworkConfig[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Mention = {
|
export type Mention = {
|
||||||
@ -95,9 +96,7 @@ class Client {
|
|||||||
attachedClients!: {
|
attachedClients!: {
|
||||||
[socketId: string]: {token: string; openChannel: number};
|
[socketId: string]: {token: string; openChannel: number};
|
||||||
};
|
};
|
||||||
config!: UserConfig & {
|
config!: UserConfig;
|
||||||
networks?: NetworkConfig[];
|
|
||||||
};
|
|
||||||
id!: number;
|
id!: number;
|
||||||
idMsg!: number;
|
idMsg!: number;
|
||||||
idChan!: number;
|
idChan!: number;
|
||||||
@ -112,11 +111,7 @@ class Client {
|
|||||||
|
|
||||||
fileHash!: string;
|
fileHash!: string;
|
||||||
|
|
||||||
constructor(
|
constructor(manager: ClientManager, name?: string, config = {} as UserConfig) {
|
||||||
manager: ClientManager,
|
|
||||||
name?: string,
|
|
||||||
config = {} as UserConfig & {networks: NetworkConfig[]}
|
|
||||||
) {
|
|
||||||
_.merge(this, {
|
_.merge(this, {
|
||||||
awayMessage: "",
|
awayMessage: "",
|
||||||
lastActiveChannel: -1,
|
lastActiveChannel: -1,
|
||||||
|
@ -285,7 +285,7 @@ class ClientManager {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const data = fs.readFileSync(userPath, "utf-8");
|
const data = fs.readFileSync(userPath, "utf-8");
|
||||||
return JSON.parse(data) as UserConfig & {networks: NetworkConfig[]};
|
return JSON.parse(data) as UserConfig;
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||||
log.error(`Failed to read user ${colors.bold(name)}: ${e}`);
|
log.error(`Failed to read user ${colors.bold(name)}: ${e}`);
|
||||||
|
Loading…
Reference in New Issue
Block a user