mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(website): sneaky sneaky 2
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -42,3 +42,4 @@ out/
|
||||
# Cache
|
||||
.prettiercache
|
||||
.eslintcache
|
||||
.vercel
|
||||
|
||||
1
apps/website/.gitignore
vendored
1
apps/website/.gitignore
vendored
@@ -13,6 +13,7 @@ pids
|
||||
|
||||
# Env
|
||||
.env
|
||||
.env*.local
|
||||
|
||||
# Dist
|
||||
dist/
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
"@microsoft/tsdoc": "0.14.2",
|
||||
"@react-icons/all-files": "^4.1.0",
|
||||
"@vercel/analytics": "^0.1.11",
|
||||
"@vercel/edge-config": "^0.1.5",
|
||||
"@vercel/og": "^0.4.1",
|
||||
"@vscode/codicons": "^0.0.32",
|
||||
"ariakit": "^2.0.0-next.43",
|
||||
|
||||
28
apps/website/src/app/api/cron/route.ts
Normal file
28
apps/website/src/app/api/cron/route.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { get } from '@vercel/edge-config';
|
||||
import { NextResponse } from 'next/server';
|
||||
import type { ServerRuntime } from 'next/types';
|
||||
|
||||
export const runtime: ServerRuntime = 'edge';
|
||||
|
||||
export async function GET() {
|
||||
const url = await get<string>('DISCORD_WEBHOOK_URL');
|
||||
const imageUrl = await get<string>('IT_IS_WEDNESDAY_MY_DUDES');
|
||||
if (url && imageUrl) {
|
||||
await fetch(url, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
username: 'It is wednesday, my dudes',
|
||||
embeds: [
|
||||
{
|
||||
image: {
|
||||
url: imageUrl,
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
return NextResponse.json({ message: 'It is wednesday, my dudes' });
|
||||
}
|
||||
8
apps/website/vercel.json
Normal file
8
apps/website/vercel.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"crons": [
|
||||
{
|
||||
"path": "/api/cron",
|
||||
"schedule": "0 0 * * 3"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -58,6 +58,7 @@
|
||||
"turbo": "^1.8.5",
|
||||
"typescript": "^5.0.2",
|
||||
"unocss": "^0.50.6",
|
||||
"vercel": "^28.18.1",
|
||||
"vitest": "^0.29.7"
|
||||
},
|
||||
"resolutions": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "https://turborepo.org/schema.json",
|
||||
"$schema": "https://turbo.build/schema.json",
|
||||
"globalDependencies": ["yarn.lock"],
|
||||
"pipeline": {
|
||||
"build": {
|
||||
|
||||
@@ -2083,6 +2083,7 @@ __metadata:
|
||||
turbo: ^1.8.5
|
||||
typescript: ^5.0.2
|
||||
unocss: ^0.50.6
|
||||
vercel: ^28.18.1
|
||||
vitest: ^0.29.7
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
@@ -2408,6 +2409,7 @@ __metadata:
|
||||
"@unocss/cli": ^0.50.6
|
||||
"@unocss/reset": ^0.50.6
|
||||
"@vercel/analytics": ^0.1.11
|
||||
"@vercel/edge-config": ^0.1.5
|
||||
"@vercel/og": ^0.4.1
|
||||
"@vitejs/plugin-react": ^3.1.0
|
||||
"@vitest/coverage-c8": ^0.29.7
|
||||
@@ -5861,6 +5863,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@vercel/edge-config@npm:^0.1.5":
|
||||
version: 0.1.5
|
||||
resolution: "@vercel/edge-config@npm:0.1.5"
|
||||
checksum: dec5f0794a6e9210f6f22b1d98f94c696f68bdcc6eed8bcd22e19572195285463663c65e2e3642bfbe2232bf0c460490b6cf3780dee638bec2b84157f4506d9b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@vercel/gatsby-plugin-vercel-analytics@npm:1.0.8":
|
||||
version: 1.0.8
|
||||
resolution: "@vercel/gatsby-plugin-vercel-analytics@npm:1.0.8"
|
||||
|
||||
Reference in New Issue
Block a user