From 6ade919bc3f1abc2550c0c51b6bab5f4663231d2 Mon Sep 17 00:00:00 2001 From: hydrabolt Date: Thu, 20 Aug 2015 17:21:56 +0100 Subject: [PATCH] Client now reworks with PM --- examples/pingpong.js | 2 +- index.js | 3 ++- package.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/pingpong.js b/examples/pingpong.js index 800029288..51a2664e3 100644 --- a/examples/pingpong.js +++ b/examples/pingpong.js @@ -27,6 +27,6 @@ myBot.on( "message", function( message ) { if ( message.content === "ping" ) { // Send a message ("pong") to the channel the message was sent in, // which is accessed by message.channel. - this.sendMessage( message.channel, "pong" ); + this.sendMessage( message, "pong" ); } } ); diff --git a/index.js b/index.js index 7c86e39ff..9b338c7cd 100644 --- a/index.js +++ b/index.js @@ -969,7 +969,8 @@ exports.Client.prototype.getServer = function( id ) { } exports.Client.prototype.getChannel = function( id ) { - return this.getChannels().filter( "id", id, true ); + var normalChan = this.getChannels().filter( "id", id, true ); + return normalChan || this.PMList.filter("id", id, true); } exports.Client.prototype.getUser = function( id ) { diff --git a/package.json b/package.json index 61fff153e..97e8e278b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord.js", - "version": "2.6.7", + "version": "2.6.8", "description": "A way to interface with the Discord API", "main": "index.js", "scripts": {