diff --git a/.github/workflows/firebase-functions-pull-request.yml b/.github/workflows/firebase-functions-pull-request.yml index 1399a9fe..eaa4c26d 100644 --- a/.github/workflows/firebase-functions-pull-request.yml +++ b/.github/workflows/firebase-functions-pull-request.yml @@ -7,9 +7,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Use Node.js 16 + - name: Use Node.js 18 uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - run: npm ci && npm run build working-directory: functions diff --git a/functions/src/eventsub.ts b/functions/src/eventsub.ts index 0ea47a7a..2e75712e 100644 --- a/functions/src/eventsub.ts +++ b/functions/src/eventsub.ts @@ -138,6 +138,12 @@ export const eventsub = functions.https.onRequest(async (req, res) => { return; } else if (status === "enabled") { const type = req.body?.subscription?.type as EventsubType; + const version = req.body?.subscription?.version as string; + + if (type === EventsubType.ChannelFollow && version === "1") { + console.log("rejecting channel.follow v1"); + return; + } const channelId = `twitch:${ req.body.event["broadcaster_user_id"] ??