Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Handle poe error responses to indicate account may be banned #455

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

qcgm1978
Copy link
Contributor

The error response likely indicates the account is banned as #329 described

截屏2023-07-23 17 43 19

…e error response likely indicates the account is banned if using the same credentials as ai-shifu#329.
@vercel
Copy link

vercel bot commented Jul 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
chatall ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2023 9:45am

@sunner
Copy link
Member

sunner commented Jul 23, 2023

Are all 400 error mean banned?

@qcgm1978
Copy link
Contributor Author

qcgm1978 commented Jul 24, 2023

I’m not sure if all 400 errors mean banned, but my account seems to be banned. I can’t use POE in the app and it’s returning 400.

I just found poe html seems changed. The following code doesn't work any more. Maybe it indicates the account is banned too. However, the robot will not be activated after this PR processing, and the results will not be affected.

const secretCode = response.data.match(
  /var .=".*",.*window\..*=function\(\)\{return .\.join\(""\)\};/,
);

@sunner
Copy link
Member

sunner commented Jul 24, 2023

If we don't know it exactly, we should not put it in code.

@sunner sunner closed this Jul 24, 2023
@sunner sunner reopened this Jul 24, 2023
Copy link
Collaborator

@PeterDaveHello PeterDaveHello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @sunner. If we don't have reliable evidence, it's best not to hard-code assumptions. Having more precise logic based on solid evidence would be ideal. Let's see if we can find more clues to improve our accuracy in handling this.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no suggestions.

Comments skipped due to low confidence (2)

src/bots/poe/PoeBot.js:227

  • The error code 'ERR_BAD_REQUEST' might not be specific enough to indicate a banned account. Consider verifying the error code or adding a more specific check.
if (error.code == 'ERR_BAD_REQUEST') {

src/bots/poe/PoeBot.js:228

  • Ensure that the error message concatenation is done correctly and does not lead to any potential issues.
error.message += '. Your account may be banned';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants