title: Telegram Bot Random Images (How to send random images with Telegram-Bot)
body: <pre><code>const TeleBot = require('telebot');
  
  
  const bot = new TeleBot({
  token: 'i9NhrhCQGq7rxaA' // Telegram Bot API token.
  });
  
  bot.on(/^([Hh]ey|[Hh]oi|[Hh]a*i)$/, function (msg) {
  return bot.sendMessage(msg.from.id, "Hello Commander");
  });
  
  var Historiepics = ['Schoolfotos/grr.jpg', 'Schoolfotos/boe.jpg', 
  'Schoolfotos/tobinsexy.jpg'];
  
  
  console.log('Historiepics')
  console.log(Math.floor(Math.random() * Historiepics.length));
  var foto = Historiepics[(Math.floor(Math.random() * Historiepics.length))];
  
  bot.on(/aap/, (msg) =&gt; {
  return bot.sendPhoto(msg.from.id, foto);
  });
  
  
  
  bot.start();
  </code></pre>
  
  <p>The result I'm getting from this is just one picture everytime, but if I ask for another random picture it keeps showing me the same one without change.</p>