-
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.
- Loading branch information
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
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,31 @@ | ||
import { TBA } from "../server/utilities/tba/tba"; | ||
import { Loop } from "../shared/loop"; | ||
import { Email, EmailType } from "../server/utilities/email"; | ||
|
||
const main = async () => { | ||
const loop = new Loop(async () => { | ||
const matches = (await TBA.get<unknown[]>('/event/2024cabl/matches/simple')).unwrap(); | ||
console.log('Matches:', matches); | ||
if (!matches) return; | ||
if (matches.length === 0) return; | ||
const e = new Email( | ||
['[email protected]', '[email protected]', '[email protected]', '[email protected]'], | ||
'Cabl Match Schedule Released', | ||
EmailType.text, | ||
{ | ||
constructor: { | ||
message: 'The match schedule for the upcoming competition has been released. Please check the schedule to see when your team is competing.', | ||
title: 'CABL Match Schedule Released', | ||
} | ||
} | ||
); | ||
console.log('Sending email'); | ||
(await e.send()).unwrap(); | ||
process.exit(0); | ||
}, 5 * 60 * 1000); | ||
|
||
|
||
loop.start(); | ||
}; | ||
|
||
main(); |