tangled
alpha
login
or
join now
dunkirk.sh
/
hackatime-bot
0
fork
atom
providing password reset services for a long while: circa 2025
0
fork
atom
overview
issues
pulls
pipelines
feat: auto make data dir
Kieran Klukas
1 year ago
79dab859
cd0e078d
+9
1 changed file
expand all
collapse all
unified
split
features
message-queue.ts
+9
features/message-queue.ts
···
1
1
import { Database } from "bun:sqlite";
2
2
+
import { mkdir } from "node:fs/promises";
2
3
import type { Block, SlackAPIClient } from "slack-edge";
3
4
4
5
export interface SlackMessage {
···
23
24
24
25
constructor(slackClient: SlackAPIClient, dbPath = "slack-queue.db") {
25
26
this.slack = slackClient;
27
27
+
const dir = dbPath.split("/").slice(0, -1).join("/");
28
28
+
if (dir) {
29
29
+
try {
30
30
+
mkdir(dir);
31
31
+
} catch (e) {
32
32
+
// Directory may already exist
33
33
+
}
34
34
+
}
26
35
this.db = new Database(dbPath);
27
36
this.initDatabase();
28
37
this.processQueue();