diff --git a/chat-plugins/flip.js b/chat-plugins/flip.js index 55dc775aaa57b..18683d9384331 100644 --- a/chat-plugins/flip.js +++ b/chat-plugins/flip.js @@ -1,9 +1,7 @@ exports.commands = { flip: function (target, room, user) { - var flipped = ''; + if (!target) return this.parse("/help flip"); if (!this.canBroadcast()) return; - for (var count = target.length - 1; count >= 0; count--) - flipped += target[count]; - return this.sendReplyBox('You input: ' + target + ' The result was: ' + flipped); + return this.sendReplyBox('You input: ' + target + ' The result was: ' + target.split("").reverse().join("")); }, };