Вы можете сгенерировать случайное число и использовать его, чтобы решить, какое действие предпринять:
r = rand # 0.0 <= r < 1
if r <= 0.5
bot.api.send_message(chat_id: message.chat.id, text: "option 1")
else if r <= 0.8
bot.api.send_message(chat_id: message.chat.id, text: "option 2")
else
# do nothing, you can actually ommit the `else` clause
end
Менее элегантный способ:
options = ["1", "1", "1", "1", "1", "2", "2", "2", nil, nil]
option = options.sample
bot.api.send_message(chat_id: message.chat.id, text: option) if option