1- import { Client , Intents , Message as RawDiscordMessage } from "discord.js" ;
2- import { CommandProcessor , connectProcessors } from "../runners/connector.js" ;
31import {
4- Message ,
2+ Client ,
3+ GatewayIntentBits ,
4+ Message as RawDiscordMessage ,
5+ } from "discord.js" ;
6+ import {
7+ type CommandProcessor ,
8+ connectProcessors ,
9+ } from "../runners/connector.js" ;
10+ import {
11+ type Message ,
512 bringBranch ,
613 bringIssue ,
714 bringPR ,
@@ -10,20 +17,15 @@ import {
1017 error ,
1118 flavor ,
1219} from "../services/command.js" ;
13- import { Analecta } from "../model/analecta.js" ;
20+ import type { Analecta } from "../model/analecta.js" ;
1421import { DiscordMessage } from "../adaptors/discord-message.js" ;
15- import { FaunaDB } from "../adaptors/fauna-db.js" ;
1622import { GitHubApi } from "../adaptors/github-api.js" ;
1723import {
1824 // Newline for format
1925 InteractionsCommandReceiver ,
2026} from "../adaptors/interactions-command.js" ;
21- import { Scheduler } from "../runners/scheduler.js" ;
2227import { TomlLoader } from "../adaptors/toml-loader.js" ;
2328import dotenv from "dotenv" ;
24- import { markAsRead } from "../services/notify/mark-as-read.js" ;
25- import { subscribeNotification } from "../services/notify/subscribe.js" ;
26- import { unsubNotification } from "../services/notify/unsubscribe.js" ;
2729
2830dotenv . config ( ) ;
2931
@@ -46,20 +48,17 @@ const messageHandler =
4648 const loader = new TomlLoader (
4749 process . env . TOML_PATH || "./analecta/laffey.toml" ,
4850 ) ;
49- const db = new FaunaDB ( process . env . FAUNA_SECRET || "UNSET" ) ;
5051 const analecta = await loader . load ( ) ;
5152
5253 const client = new Client ( {
5354 intents : [
54- Intents . FLAGS . DIRECT_MESSAGES ,
55- Intents . FLAGS . GUILDS ,
56- Intents . FLAGS . GUILD_MESSAGES ,
55+ GatewayIntentBits . DirectMessages ,
56+ GatewayIntentBits . Guilds ,
57+ GatewayIntentBits . GuildMessages ,
5758 ] ,
5859 } ) ;
5960 const query = new GitHubApi ( ) ;
6061
61- const scheduler = new Scheduler ( ) ;
62-
6362 const builtProcs = connectProcessors ( [
6463 flavor (
6564 new RegExp ( analecta . CallPattern , "u" ) ,
@@ -71,16 +70,6 @@ const messageHandler =
7170 bringBranch ( query , analecta ) ,
7271 bringRepo ( query , analecta ) ,
7372 createIssue ( query , analecta ) ,
74- subscribeNotification ( {
75- db,
76- registry : db ,
77- query,
78- associator : query ,
79- analecta,
80- scheduler,
81- } ) ,
82- unsubNotification ( db , analecta , scheduler ) ,
83- markAsRead ( db , query , analecta ) ,
8473 error ( analecta ) ,
8574 ] ) ;
8675
0 commit comments