title: How to send an image from a telegram bot
body: <p>I have my bot working by now, but the thing is it can only send text. I have seen in the Bot API there are functions to send photos, videos... but I can't get it to work. Someone has achieved it? I'm using python source code from <a href="https://github.com/yukuku/telebot" rel="nofollow">yukuku/telebot</a></p>
  
  <pre><code> elif text == '/image':
              img = Image.new('RGB', (512, 512))
              base = random.randint(0, 16777216)
              pixels = [base+i*j for i in range(512) for j in range(512)]  # generate sample image
              img.putdata(pixels)
              output = StringIO.StringIO()
              img.save(output, 'JPEG')
              reply(img=output.getvalue())
  </code></pre>
  
  <p>When I change the code, nothing happened.</p>
  
  <pre><code>img = Image.open('image.png')
  img.show()
  </code></pre>
  
  <p>Please help me. I need the correct code. Sorry for my bad English.</p>