From c336d6f0afb41015b723fe6d30989fb3097605a8 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Wed, 14 Dec 2022 13:05:16 -0600 Subject: [PATCH] chore: add GitHub issue template --- .../.github/ISSUE_TEMPLATE/1.bug_report.yml | 70 +++++++++++++++++++ legacy/.github/ISSUE_TEMPLATE/config.yml | 5 ++ legacy/src/openai-auth.ts | 6 +- 3 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 legacy/.github/ISSUE_TEMPLATE/1.bug_report.yml create mode 100644 legacy/.github/ISSUE_TEMPLATE/config.yml diff --git a/legacy/.github/ISSUE_TEMPLATE/1.bug_report.yml b/legacy/.github/ISSUE_TEMPLATE/1.bug_report.yml new file mode 100644 index 00000000..dbeed780 --- /dev/null +++ b/legacy/.github/ISSUE_TEMPLATE/1.bug_report.yml @@ -0,0 +1,70 @@ +name: Bug Report +description: Create a bug report +labels: ['template: bug'] +body: + - type: markdown + attributes: + value: 'If you follow all of the instructions carefully, and your account / IP hasn't been permanently flagged by Cloudflare / OpenAI, then you shouldn't ever get a 403 at this point.' + - type: markdown + attributes: + value: 'My Twitter bot has been running for the past 2 days without a single 403, and others have been able to get it working on Discord. Although it can take a bit of effort to get working, once you have it working, you're set.' + - type: checkboxes + attributes: + label: Verify latest release + description: '`chatgpt@latest` is the latest version of `chatgpt`. Some issues may already be fixed in the latest version, so please verify that your issue reproduces before opening a new issue.' + options: + - label: I verified that the issue exists in the latest `chatgpt` release + required: true + - type: checkboxes + attributes: + label: Verify webapp is working + description: 'Verify that the [ChatGPT webapp](https://chat.openai.com/) is working for you locally using the same browser and account.' + options: + - label: I verify that the ChatGPT webapp is working properly for this account. + required: true + - type: checkboxes + attributes: + label: Verify [restrictions](https://github.com/transitive-bullshit/chatgpt-api#restrictions) + description: 'Verify that you\'ve double-checked all of the restrictions listed in the readme.' + options: + - label: I verify that I've double-checked all of the restrictions. + required: true + - type: textarea + attributes: + label: Provide environment information + description: Please enter `node --version`, `Chrome` version, OS, OS version. + validations: + required: true + - type: input + attributes: + label: Link to the code that reproduces this issue + description: A link to a GitHub repository you own with a minimal reproduction. Minimal reproductions should be forked from this repo and should include only changes that contribute to the issue. + validations: + required: true + - type: textarea + attributes: + label: To Reproduce + description: Steps to reproduce the behavior, please provide a clear description of how to reproduce the issue, based on the linked minimal reproduction. Screenshots can be provided in the issue body below. If using code blocks, make sure that [syntax highlighting is correct](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting) and double check that the rendered preview is not broken. **Is `getOpenAIAuth` returning successfully? If so, please print out its values.** If not, please describe what happens in the browser when trying to auth. + validations: + required: true + - type: textarea + attributes: + label: Describe the Bug + description: A clear and concise description of what the bug is. + validations: + required: true + - type: textarea + attributes: + label: Expected Behavior + description: A clear and concise description of what you expected to happen. + validations: + required: true + - type: markdown + attributes: + value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. + - type: markdown + attributes: + value: Contributors should be able to follow the steps provided in order to reproduce the bug. + - type: markdown + attributes: + value: These steps are used to improve the docs to ensure the same issue does not happen again. Thanks in advance! diff --git a/legacy/.github/ISSUE_TEMPLATE/config.yml b/legacy/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..d4b36c7d --- /dev/null +++ b/legacy/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: Ask a question + url: https://github.com/vercel/next.js/discussions + about: Ask questions and discuss with other community members diff --git a/legacy/src/openai-auth.ts b/legacy/src/openai-auth.ts index 7c9179f4..476c6119 100644 --- a/legacy/src/openai-auth.ts +++ b/legacy/src/openai-auth.ts @@ -227,17 +227,17 @@ export const defaultChromeExecutablePath = (): string => { } async function checkForChatGPTAtCapacity(page: Page) { - let res: ElementHandle[] + let res: ElementHandle | null try { - res = await page.$x("//div[contains(., 'ChatGPT is at capacity')]") + res = await page.$('[role="alert"]') console.log('capacity text', res) } catch (err) { // ignore errors likely due to navigation console.warn(err.toString()) } - if (res?.length) { + if (res) { const error = new types.ChatGPTError('ChatGPT is at capacity') error.statusCode = 503 throw error