TheExplainthis / ChatGPT-Line-Bot

This is a repository that allows you to integrate ChatGPT into Line.
MIT License
1.5k stars 1.82k forks source link

Update LINE Bot SDK from deprecated to latest v3 #50

Open mcc311 opened 10 months ago

mcc311 commented 10 months ago

Description:

This PR addresses the deprecation warnings from the LINE Bot SDK by updating the code to use the latest v3. The changes ensure compatibility with the most recent version of the SDK, improve maintainability, and ensure continued smooth operations.

Key Changes:

  1. Updated the SDK imports to v3 format.
  2. Migrated from deprecated TextMessage class to TextSendMessage and other similar changes for different types of messages.
  3. Refactored audio message handling to be compatible with the v3 SDK.
  4. Removed unnecessary configurations and adjusted for API changes in messaging.
  5. Cleaned up and standardized the error handling messages.

Testing:

  1. Test the bot to ensure that it can still receive and reply to text messages without any issues.
  2. Test the audio transcription feature and verify the bot's response.
  3. Ensure that API token registration and related commands are still working as expected.
  4. Check error handling behavior, especially with regards to OpenAI API token errors.
  5. Verify that the image messaging feature functions properly and displays images as expected.