line-bot-sdk-python icon indicating copy to clipboard operation
line-bot-sdk-python copied to clipboard

get_message_content() returns None if content is audio

Open THChen2002 opened this issue 8 months ago • 2 comments

System Informations

  • Python version:3.9.12
  • SDK version:3.17.1
  • OS:macOS

Expected Behavior

Calling get_message_content() should return a bytearray.

Current Behavior

Instead of returning a bytearray, get_message_content() returns None. This issue occurs when the content type is mp3. As a temporary workaround, I'm currently using get_message_content_with_http_info() to retrieve the content.

THChen2002 avatar May 17 '25 16:05 THChen2002

@THChen2002 Thanks for the bug report! Unfortunately, I retrieved the Audio data with https://github.com/line/line-bot-sdk-python/blob/107447f032e496b82c4668032af295462a3a8263/linebot/v3/messaging/api/messaging_api_blob.py#L49-L76 in the same environment, and it worked fine, so I could not reproduce the bug.

Please provide a simple code to reproduce the bug.

mokuzon avatar May 23 '25 07:05 mokuzon

Sorry about the description. The result will return None if I call get_message_content() after I got the audio message content. If I run it later, it can works. The following screenshot I provided is the situation.

Image

THChen2002 avatar May 23 '25 15:05 THChen2002