node.js Chat bot command


#1
> nativeBot.onText(/^\/trivia/, function(msg, match) {
var fromId = msg.chat.id;
var questions = ['Question 1', 'Question 2', 'Question 3', 'Question 4', 'Question 5', 'Question 6'];
  var chosenQuestions = questions[Math.floor(Math.random() * questions.length)];
  Bot.sendMessage(msg.chat.id, chosenQuestions);
});

#2

Is there a question here? :slight_smile: