Skip to content

bale.error.HTTPException: Can not serialize value type: <class 'dict'> #53

Description

@MoSi8160

what is your bale bot version?

2.4.8.1

Reproduction Steps

when i was send photo with component with code below:
await message.reply_photo(caption='بازگشت', components=component, photo=InputFile(profile_pic))
note: variable 'profile_pic' contain str location to .png path of photo

Exception Result

Traceback (most recent call last):
  File "C:\Users\GREEN-Z4\AppData\Local\Programs\Python\Python311\Lib\site-packages\bale\bot.py", line 239, in run_event
    await core(*args, **kwargs)
  File "d:\MaMaD\TELEGRAM BOT\bale\bale_bot.py", line 122, in on_message
    await profile_photo_send_picture(message)
  File "d:\MaMaD\TELEGRAM BOT\bale\bale_bot.py", line 110, in profile_photo_send_picture
    await query(caption=TEXT['profile_pic_send_photo_text'][lang], components=component, photo=InputFile(profile_pic))
  File "C:\Users\GREEN-Z4\AppData\Local\Programs\Python\Python311\Lib\site-packages\bale\message.py", line 246, in reply_photo
    return await self.bot.send_photo(self.chat_id, photo, caption=caption,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\GREEN-Z4\AppData\Local\Programs\Python\Python311\Lib\site-packages\bale\bot.py", line 554, in send_photo
    response = await self.http.send_photo(str(chat_id), [photo.to_dict('photo')], caption=caption,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\GREEN-Z4\AppData\Local\Programs\Python\Python311\Lib\site-packages\bale\request\http.py", line 162, in request
    raise HTTPException(error)
bale.error.HTTPException: Can not serialize value type: <class 'dict'>
 headers: {}
 value: {'inline_keyboard': [[{'text': 'بازگشت', 'callback_data': 'RETURN'}]]}

System Information

No response

Metadata

Metadata

Labels

bug 🐛Something isn't workingwontfixThis will not be worked on

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions