diff --git a/.env.example b/.env.example index 644e10b3..5c3ea08c 100644 --- a/.env.example +++ b/.env.example @@ -2,6 +2,6 @@ DISCORD_HASH= DISCORD_PUBLIC_KEY= DISCORD_APP_ID= GUILD_ID=614601782152265748 -GITHUB_TOKEN= +GH_READ_TOKEN= AMPLITUDE_KEY= OPENAI_KEY= diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 171fa4fe..50299294 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -90,7 +90,7 @@ jobs: --from-literal=DISCORD_PUBLIC_KEY=${{ secrets.DISCORD_PUBLIC_KEY }} \ --from-literal=DISCORD_APP_ID=${{ secrets.DISCORD_APP_ID }} \ --from-literal=GUILD_ID=${{ secrets.GUILD_ID }} \ - --from-literal=GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \ + --from-literal=GH_READ_TOKEN=${{ secrets.GH_READ_TOKEN }} \ --from-literal=AMPLITUDE_KEY=${{ secrets.AMPLITUDE_KEY }} \ --from-literal=OPENAI_KEY=${{ secrets.OPENAI_KEY }} \ || echo \n diff --git a/cluster/deployment.yaml b/cluster/deployment.yaml index a54ba95d..b5af2600 100644 --- a/cluster/deployment.yaml +++ b/cluster/deployment.yaml @@ -23,11 +23,11 @@ spec: secretKeyRef: name: reactibot-env key: DISCORD_HASH - - name: GITHUB_TOKEN + - name: GH_READ_TOKEN valueFrom: secretKeyRef: name: reactibot-env - key: GITHUB_TOKEN + key: GH_READ_TOKEN - name: AMPLITUDE_KEY valueFrom: secretKeyRef: diff --git a/src/features/voice-activity.ts b/src/features/voice-activity.ts index d310f548..4bcebc89 100644 --- a/src/features/voice-activity.ts +++ b/src/features/voice-activity.ts @@ -51,7 +51,6 @@ const voiceActivity = (bot: Client) => { bot.on("voiceStateUpdate", (oldState, newState) => { const { member, channel } = newState; - console.log({ member, channel, oldState }); if (!member) { return; } diff --git a/src/helpers/env.ts b/src/helpers/env.ts index 1891e33f..c79b4804 100644 --- a/src/helpers/env.ts +++ b/src/helpers/env.ts @@ -24,7 +24,7 @@ export const applicationKey = getEnv("DISCORD_PUBLIC_KEY"); export const applicationId = getEnv("DISCORD_APP_ID"); export const guildId = getEnv("GUILD_ID"); export const discordToken = getEnv("DISCORD_HASH"); -export const gitHubToken = getEnv("GITHUB_TOKEN", true); +export const gitHubReadToken = getEnv("GH_READ_TOKEN", true); export const amplitudeKey = getEnv("AMPLITUDE_KEY", true); export const openAiKey = getEnv("OPENAI_KEY", true); diff --git a/src/helpers/react-docs.ts b/src/helpers/react-docs.ts index 41e382f8..a48b437a 100644 --- a/src/helpers/react-docs.ts +++ b/src/helpers/react-docs.ts @@ -1,5 +1,5 @@ import fetch from "node-fetch"; -import { gitHubToken } from "./env"; +import { gitHubReadToken } from "./env"; const LOOKUP_REGEX = /\s*(.*?)\s*<\/Intro>/gs; const LINK_REGEX = /\[([^\]]+)\]\((?!https?:\/\/)([^)]+)\)/g; @@ -13,7 +13,7 @@ export const getReactDocsContent = async (searchPath: string) => { method: "GET", headers: { Accept: "application/vnd.github+json", - Authorization: `Bearer ${gitHubToken}`, + Authorization: `Bearer ${gitHubReadToken}`, "X-GitHub-Api-Version": "2022-11-28", }, });