From 95db1d611b908beb207e2b8494508a69850be481 Mon Sep 17 00:00:00 2001 From: abalabahaha Date: Fri, 29 Jul 2016 07:03:47 +0900 Subject: [PATCH] Fix reference to nonexistent property --- lib/Client/InternalClient.js | 3 ++- src/Client/InternalClient.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Client/InternalClient.js b/lib/Client/InternalClient.js index 5307784d6..06d54c61f 100644 --- a/lib/Client/InternalClient.js +++ b/lib/Client/InternalClient.js @@ -132,7 +132,7 @@ var InternalClient = (function () { var match = url.match(/\/channels\/([0-9]+)\/messages(\/[0-9]+)?$/); if (match) { if (method === "del" && (match[1] = this.channels.get("id", match[1]))) { - buckets = ["dmsg:" + (match[1].guild ? match[1].guild.id : undefined)]; + buckets = ["dmsg:" + (match[1].server ? match[1].server.id : undefined)]; } else if (this.user.bot) { if (method === "post" || method === "patch") { if (this.private_channels.get("id", match[1])) { @@ -252,6 +252,7 @@ var InternalClient = (function () { this.buckets = { "bot:msg:dm": new _UtilBucket2["default"](5, 5000), "bot:msg:global": new _UtilBucket2["default"](50, 10000), + "dmsg:undefined": new _UtilBucket2["default"](5, 1000), "msg": new _UtilBucket2["default"](10, 10000), "username": new _UtilBucket2["default"](2, 3600000) }; diff --git a/src/Client/InternalClient.js b/src/Client/InternalClient.js index 01235b8cc..66f0f4206 100755 --- a/src/Client/InternalClient.js +++ b/src/Client/InternalClient.js @@ -62,7 +62,7 @@ export default class InternalClient { var match = url.match(/\/channels\/([0-9]+)\/messages(\/[0-9]+)?$/); if(match) { if(method === "del" && (match[1] = this.channels.get("id", match[1]))) { - buckets = ["dmsg:" + (match[1].guild ? match[1].guild.id : undefined)]; + buckets = ["dmsg:" + (match[1].server ? match[1].server.id : undefined)]; } else if(this.user.bot) { if(method === "post" || method === "patch") { if(this.private_channels.get("id", match[1])) { @@ -169,6 +169,7 @@ export default class InternalClient { this.buckets = { "bot:msg:dm": new Bucket(5, 5000), "bot:msg:global": new Bucket(50, 10000), + "dmsg:undefined": new Bucket(5, 1000), "msg": new Bucket(10, 10000), "username": new Bucket(2, 3600000) };