📜  discord.js 从数组中随机选择 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:26.210000             🧑  作者: Mango

代码示例1
var answers = [
  "Hey",
  "Howdy",
  "Hello There",
  "Wotcha",
  "Alright gov'nor"
]

var randomAnswer = answers[Math.floor(Math.random() * answers.length)];

console.log(randomAnswer);