4

I am developing an image generation bot for chat (for example, chat.stackexchange.com).

I can generate the image correctly, but when it comes to posting the image, I have no idea how to upload the image into chat via Python. Is there an API or some "hack" to upload the image from filesystem to i.sstatic.net without using any side sites (imgBB, Imgur, etc.)?

4
  • 2
    I don't have a Python script but there is one in Go that I assume should work: github.imc.re/nathan-osman/go-sechat/blob/master/image.go Commented Jun 25, 2024 at 17:53
  • Does it support deletion afterwards? Commented Aug 31, 2024 at 17:20
  • FWIW this is possible via /upload/image. Here is another implementation (in Java) apart from the one in Go @rene mentioned. See also this closely related question. Commented Sep 7, 2024 at 15:14
  • Also: /upload/image allows uploading in two ways: by giving a direct link to the image or by sending the image file itself. I've successfully uploaded images using the first method in Python, but I can't make my script to work with the second one. Commented Sep 7, 2024 at 15:18

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.