module.exports = {
  commands: {
    random: {
      help: 'Selects a random choice or number',
      command: function (bot, msg) {
        if (msg.args.length > 2) {
          msg.args.shift()
          return msg.args[Math.floor(Math.random() * msg.args.length)]
        } else if (msg.args.length === 2) {
          var res = Math.floor(Math.random() * Math.floor(msg.args[1]))
          if (!isNaN(res)) {
            return res
          }
        }
        return 'Usage: (<number>|<choice 1> … <choice n>)'
      }
    },
    coin: {
      help: 'Flips a coin',
      command: function () {
        var faces = ['Heads!', 'Tails!']
        return faces[Math.floor(Math.random() * faces.length)]
      }
    }
  }
}

@@ -198,22 +198,31 @@
         
-return
+const randint =
  msg.arg
@@ -264,24 +264,60 @@
 gs.length)%5D%0A
+          return randint.toString()%0A
         %7D el

Fix for #396