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 'no_access' status for Claude-instant (a2) bot #206

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

jishux2
Copy link
Contributor

@jishux2 jishux2 commented Nov 11, 2024

Description

This PR fixes a bug where the code crashes when attempting to access Claude-instant (a2) bot, which is now private and inaccessible. The current code doesn't handle the no_access status properly, resulting in a TypeError when trying to access attributes of None.

Changes Made

  1. Added handling for no_access status in message response
  2. Added safety checks before accessing chat data
  3. Improved error handling to provide clearer error messages

Additional Notes

The README.md currently uses Claude-instant (a2) in its examples. Since this bot is no longer accessible, it would be helpful to update the examples to use a different bot that's currently available.

Error Details

When trying to access Claude-instant (a2), the API returns:

{
    "data": {
        "messageEdgeCreate": {
            "message": None,
            "status": "no_access",
            "statusMessage": "Claude-instant has been made private by its creator. Your chat history is saved but you won't be able to send new messages to this bot. Try @mentioning another bot."
        }
    }
}

Without proper handling, this leads to:

TypeError: 'NoneType' object is not subscriptable

@snowby666 snowby666 merged commit 420b75a into snowby666:main Nov 15, 2024
1 check passed
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.

2 participants