-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
436a581
commit a7cda1e
Showing
14 changed files
with
166 additions
and
367 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
PORT=8080 | ||
WEBHOOK_TOKEN="❤" | ||
DISCORD_APPLICATION_ID="❤" | ||
DISCORD_TOKEN="❤" | ||
DISCORD_PUBLIC_KEY="❤" | ||
DISCORD_WEBHOOK_URL="❤" | ||
DISCORD_CHANNEL_ID="❤" | ||
KV_URL="❤" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
export { | ||
assertEquals, | ||
assertRejects, | ||
} from "https://deno.land/std@0.211.0/assert/mod.ts"; | ||
export { load } from "https://deno.land/std@0.211.0/dotenv/mod.ts"; | ||
export * from "https://deno.land/std@0.211.0/datetime/constants.ts"; | ||
} from "https://deno.land/std@0.218.2/assert/mod.ts"; | ||
export { load } from "https://deno.land/std@0.218.2/dotenv/mod.ts"; | ||
export * from "https://deno.land/std@0.218.2/datetime/constants.ts"; | ||
export { ulid } from "https://deno.land/x/[email protected]/mod.ts"; | ||
export type { | ||
APIApplicationCommandInteractionDataOption, | ||
|
@@ -16,12 +16,12 @@ export type { | |
APIUser, | ||
RESTPostAPIApplicationCommandsJSONBody, | ||
RESTPostAPIWebhookWithTokenJSONBody, | ||
} from "https://deno.land/x/[email protected].67/v10.ts"; | ||
} from "https://deno.land/x/[email protected].71/v10.ts"; | ||
export { | ||
ApplicationCommandOptionType, | ||
InteractionResponseType, | ||
InteractionType, | ||
MessageFlags, | ||
Utils, | ||
} from "https://deno.land/x/[email protected].67/v10.ts"; | ||
} from "https://deno.land/x/[email protected].71/v10.ts"; | ||
export { default as nacl } from "https://cdn.skypack.dev/[email protected]"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { executeDailyWebhook } from "lc-dailies/lib/api/dailies.ts"; | ||
import * as lc from "lc-dailies/lib/lc/mod.ts"; | ||
import { DISCORD_WEBHOOK_URL, KV_URL } from "lc-dailies/env.ts"; | ||
import { DenoKvLeaderboardClient } from "lc-dailies/lib/leaderboard/denokv/mod.ts"; | ||
|
||
export function setupCron() { | ||
Deno.cron("discord_webhook", { dayOfWeek: { every: 1 } }, async () => { | ||
const kv = await Deno.openKv(KV_URL); | ||
const lcClient = new lc.LCClient(); | ||
const leaderboardClient = new DenoKvLeaderboardClient( | ||
kv, | ||
lcClient, | ||
); | ||
await executeDailyWebhook( | ||
lcClient, | ||
leaderboardClient, | ||
DISCORD_WEBHOOK_URL, | ||
); | ||
}); | ||
|
||
// TODO: Abstract sync function from executeDailyWebhook. | ||
Deno.cron("sync", {}, () => {}); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
a7cda1e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed to deploy: