From a6bcb7befb503764ce1a77cbb5fa820cb962f1dc Mon Sep 17 00:00:00 2001 From: hydrabolt Date: Fri, 14 Aug 2015 12:38:49 +0100 Subject: [PATCH] Added method to test whether string is ID --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index c9edda165..a4cfc21a8 100644 --- a/index.js +++ b/index.js @@ -9,6 +9,10 @@ var Invite = require( "./lib/invite.js" ).Invite; var PMChannel = require( "./lib/PMChannel.js" ).PMChannel; var WebSocket = require( 'ws' ); +exports.prototype.isUserID = function(id){ + return ((id + "").length === 17 && !isNaN(id)); +} + exports.Client = function( options ) { this.options = options || {};