Skip to content

Commit dffc6c7

Browse files
author
xyzjesper
committed
Bump Config Version (1.1.0). Fix Database and DH Files
1 parent c654133 commit dffc6c7

File tree

6 files changed

+12
-17
lines changed

6 files changed

+12
-17
lines changed

src/api/eventsAPI/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ interface AuthenticatedSocket extends Socket {
1717

1818
export async function setupSocketIO(client: ExtendedClient) {
1919
// Port configuration with fallbacks
20-
const apiPort = Config.Other.WsPort
21-
? Number(Config.Other.WsPort) : 3459;
20+
const apiPort = Config.Other.EventsApi.WsPort
21+
? Number(Config.Other.EventsApi.WsPort) : 3459;
2222

2323
io = new Server(apiPort);
2424

src/emojis/lockopen.png

170 Bytes
Loading

src/main/config.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,13 @@ export async function configStartup() {
6262
EventsApi: {
6363
ApiKey: "",
6464
ApiPort: 0,
65+
WsPort: 0,
6566
},
66-
WsPort: 0,
6767
API: {
6868
ApiPort: 0,
6969
ApiKey: "",
7070
},
7171
},
72-
Database: {
73-
MongodbUrl: "",
74-
DbName: "",
75-
},
7672
Logging: {
7773
ErrorWebhook: "",
7874
BotLogger: "",
@@ -81,9 +77,14 @@ export async function configStartup() {
8177
CONFIG_VERSION: botData.configVersion,
8278
};
8379

80+
const doc = new YAML.Document();
81+
doc.contents = configData as any;
82+
83+
doc.commentBefore = ` DisBot Config v${botData.configVersion} of version ${botData.version}\n Read more: https://doc.xyzhub.link/s/disbot/doc/config-yXEob11woF`;
84+
8485
fs.writeFileSync(
8586
process.env.CONFIG_PATH,
86-
YAML.stringify(configData)
87+
YAML.stringify(doc)
8788
);
8889
}
8990

src/main/database.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ export let database: PrismaClient = new PrismaClient();
1212

1313
export async function connectToDatabase(client: ExtendedClient) {
1414

15-
const dbClient = new PrismaClient({
16-
datasourceUrl: Config.Database.MongodbUrl
17-
});
15+
const dbClient = new PrismaClient();
1816
await dbClient.$connect().then(() => {
1917
Logger.info(
2018
{

src/main/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export const botData = {
22
version: "1.6.2",
3-
configVersion: "1.0.1",
3+
configVersion: "1.1.0",
44
};

src/types/config.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,13 @@ export type DisBotConfigData = {
4747
EventsApi: {
4848
ApiKey: string;
4949
ApiPort: number;
50+
WsPort: number;
5051
};
51-
WsPort: number;
5252
API: {
5353
ApiPort: number;
5454
ApiKey: string;
5555
};
5656
};
57-
Database: {
58-
MongodbUrl: string;
59-
DbName: string;
60-
};
6157
Logging: {
6258
ErrorWebhook: string;
6359
BotLogger: string;

0 commit comments

Comments
 (0)