Skip to content

How to send local image to chat using incoming webhook #108

@manirhel-zz

Description

@manirhel-zz

Facing issue while send the local image to google chat room using web hook. please find the code below. kindly help.

attachment = open("images.jpg", "rb")
bot_message = {"cards": [{ "sections": [{"widgets": [{"image": attachment}]}]}]}
print (bot_message)
message_headers = {'Content-Type': 'application/json; charset=UTF-8'}

Error:

TypeError: Object of type BufferedReader is not JSON serializable

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions