kramcat / CharacterAI

Unofficial Python API for character.ai
https://docs.kram.cat
MIT License
434 stars 61 forks source link

Perform get chat from room #52

Closed bakunya closed 12 months ago

bakunya commented 1 year ago

This pull request introduces a new feature to retrieve chat messages from chat characters or room. The feature can be used in two ways:

  1. From Chat Character:

    • You can now fetch chat messages associated with a specific character by using the following code:
      await client.chat.get_chat(char="ID")

      Where "ID" represents the character's ID, which can be obtained from the URL parameter /chat?char=ID.

  2. From Room Chat:

    • Additionally, you can retrieve chat messages related to a specific chat history by using this code:
      await client.chat.get_chat(history_id="ID")

      Here, "ID" corresponds to the history ID, which can be extracted from the URL parameter /chat?hist=ID.

Please review and merge this pull request to incorporate these changes into the codebase.