Fix reference to nonexistent property

This commit is contained in:
abalabahaha
2016-07-29 07:03:47 +09:00
parent 41dab17ec0
commit 95db1d611b
2 changed files with 4 additions and 2 deletions

View File

@@ -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)
};

View File

@@ -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)
};