Skip to content

Commit d36be9a

Browse files
committed
chore: init new ama bot
1 parent c0569d6 commit d36be9a

File tree

8 files changed

+92
-0
lines changed

8 files changed

+92
-0
lines changed

packages/private/backend-core/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
},
2525
"dependencies": {
2626
"@sapphire/discord-utilities": "^3.5.0",
27+
"bin-rw": "^0.1.1",
2728
"kysely": "^0.28.7",
2829
"pg": "^8.16.3",
2930
"pino": "^9.12.0",

packages/private/backend-core/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
export * from '@chatsift/core';
22

3+
export * from './lib/data/bots.js';
4+
35
export * from './lib/context.js';
46
export * from './lib/database.js';
57
export * from './lib/env.js';
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { createRecipe, DataType } from 'bin-rw';
2+
3+
export const BOTS = ['AMA'];
4+
5+
export type BotId = (typeof BOTS)[number];
6+
7+
export const GlobalCaches = {
8+
/**
9+
* Not to be used in such a way to risk race conditions. There should really be one place that sets this per bot,
10+
* in the gateway, and then as many readers as needed.
11+
*/
12+
GuildList: {
13+
key: (id: BotId) => `bot:${id}:guilds`,
14+
recipe: createRecipe({
15+
guilds: [DataType.String],
16+
}),
17+
},
18+
} as const;

services/ama-bot/package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "@chatsift/ama-bot",
3+
"private": true,
4+
"version": "1.0.0",
5+
"type": "module",
6+
"exports": {
7+
".": "./dist/index.js"
8+
},
9+
"scripts": {
10+
"build": "tsc",
11+
"test": "vitest run",
12+
"test:watch": "vitest",
13+
"lint": "eslint src",
14+
"lint:fix": "eslint src --fix",
15+
"clean": "rimraf dist",
16+
"tag-docker": "docker image tag chatsift/chatsift-next:latest chatsift/chatsift-next:ama"
17+
},
18+
"devDependencies": {
19+
"@types/node": "^24.6.1",
20+
"kysely": "^0.28.7",
21+
"typescript": "~5.9.3",
22+
"vitest": "^3.2.4"
23+
},
24+
"dependencies": {
25+
"@chatsift/backend-core": "workspace:^",
26+
"@discordjs/core": "^3.0.0-dev.1759363313-f510b5ffa",
27+
"@discordjs/rest": "^3.0.0-dev.1759363313-f510b5ffa",
28+
"@discordjs/ws": "^3.0.0-dev.1759363313-f510b5ffa",
29+
"nanoid": "^5.1.6"
30+
}
31+
}

services/ama-bot/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('.');
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "../../tsconfig.eslint.json",
3+
"include": ["src/**/*"]
4+
}

services/ama-bot/tsconfig.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"outDir": "./dist",
5+
"rootDir": "./src",
6+
"declaration": false,
7+
"declarationMap": false,
8+
},
9+
"include": ["src/**/*"],
10+
"exclude": ["dist", "node_modules"]
11+
}

yarn.lock

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,22 @@ __metadata:
541541
languageName: node
542542
linkType: hard
543543

544+
"@chatsift/ama-bot@workspace:services/ama-bot":
545+
version: 0.0.0-use.local
546+
resolution: "@chatsift/ama-bot@workspace:services/ama-bot"
547+
dependencies:
548+
"@chatsift/backend-core": "workspace:^"
549+
"@discordjs/core": "npm:^3.0.0-dev.1759363313-f510b5ffa"
550+
"@discordjs/rest": "npm:^3.0.0-dev.1759363313-f510b5ffa"
551+
"@discordjs/ws": "npm:^3.0.0-dev.1759363313-f510b5ffa"
552+
"@types/node": "npm:^24.6.1"
553+
kysely: "npm:^0.28.7"
554+
nanoid: "npm:^5.1.6"
555+
typescript: "npm:~5.9.3"
556+
vitest: "npm:^3.2.4"
557+
languageName: unknown
558+
linkType: soft
559+
544560
"@chatsift/api@workspace:^, @chatsift/api@workspace:services/api":
545561
version: 0.0.0-use.local
546562
resolution: "@chatsift/api@workspace:services/api"
@@ -578,6 +594,7 @@ __metadata:
578594
"@sapphire/discord-utilities": "npm:^3.5.0"
579595
"@types/node": "npm:^24.6.1"
580596
"@types/pg": "npm:^8"
597+
bin-rw: "npm:^0.1.1"
581598
kysely: "npm:^0.28.7"
582599
pg: "npm:^8.16.3"
583600
pino: "npm:^9.12.0"
@@ -6552,6 +6569,13 @@ __metadata:
65526569
languageName: node
65536570
linkType: hard
65546571

6572+
"bin-rw@npm:^0.1.1":
6573+
version: 0.1.1
6574+
resolution: "bin-rw@npm:0.1.1"
6575+
checksum: 10c0/c859c78cd7839c45fa761a1d2153b33790ed405c8af5740fe0789753e7d54ed3e329069c4342c198afde22179fe21c2e840f666a3a8a11dddba24ebf90e2a2ac
6576+
languageName: node
6577+
linkType: hard
6578+
65556579
"binary-extensions@npm:^2.0.0":
65566580
version: 2.3.0
65576581
resolution: "binary-extensions@npm:2.3.0"

0 commit comments

Comments
 (0)