-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: Apply RSAPE * refactor: Move procs into run * refactor: Rename MockDB into MockUserDB * refactor: Tidy up mock classes * refactor: Move messageHandler into procs * refactor: Rename notify modules * fix: Apply renaming runner * lint: Remove disable-eslint * fix: Fix typo * refactor: Extract to local variable * fix: Use console.dir * fix: Refactor omit
- Loading branch information
1 parent
9d7fddd
commit e5c480a
Showing
22 changed files
with
87 additions
and
89 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/bot/play/subscribe/mark-as-read.test.ts → src/bot/play/notify/mark-as-read.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
.../subscribe/subscribe-notification.test.ts → src/bot/play/notify/subscribe.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
...ubscribe/unsubscribe-notification.test.ts → src/bot/play/notify/unsubscribe.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { messageHandler, procs } from "./procs"; | ||
import { Client } from "discord.js"; | ||
import { FaunaDB } from "../skin/fauna-db"; | ||
import { GitHubApi } from "../skin/github-api"; | ||
import { SubscriptionNotifier } from "../skin/notifier"; | ||
import { TomlLoader } from "../skin/toml-loader"; | ||
import dotenv from "dotenv"; | ||
|
||
dotenv.config(); | ||
|
||
(async () => { | ||
const loader = new TomlLoader( | ||
process.env.TOML_PATH || "./analecta/laffey.toml", | ||
); | ||
const db = new FaunaDB(process.env.FAUNA_SECRET || "UNSET"); | ||
const analecta = await loader.load(); | ||
|
||
const client = new Client(); | ||
const notifier = new SubscriptionNotifier(analecta, client.users, db); | ||
db.onUpdate(notifier); | ||
const query = new GitHubApi(); | ||
|
||
const builtProcs = procs(analecta, db, query); | ||
|
||
client.on("ready", () => { | ||
console.log("I got ready."); | ||
}); | ||
|
||
client.on("message", messageHandler(analecta, builtProcs)); | ||
|
||
client.login(process.env.DISCORD_TOKEN); | ||
})().catch((err) => console.error(err)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters