diff --git a/lib/Client/InternalClient.js b/lib/Client/InternalClient.js index 2db665f25..5307784d6 100644 --- a/lib/Client/InternalClient.js +++ b/lib/Client/InternalClient.js @@ -131,15 +131,15 @@ var InternalClient = (function () { var buckets = []; var match = url.match(/\/channels\/([0-9]+)\/messages(\/[0-9]+)?$/); if (match) { - if (this.user.bot) { + if (method === "del" && (match[1] = this.channels.get("id", match[1]))) { + buckets = ["dmsg:" + (match[1].guild ? match[1].guild.id : undefined)]; + } else if (this.user.bot) { if (method === "post" || method === "patch") { if (this.private_channels.get("id", match[1])) { buckets = ["bot:msg:dm", "bot:msg:global"]; } else if (match[1] = this.channels.get("id", match[1])) { buckets = ["bot:msg:guild:" + match[1].id, "bot:msg:global"]; } - } else if (method === "del" && (match[1] = this.channels.get("id", match[1]))) { - buckets = ["dmsg:" + match[1].id]; } } else { buckets = ["msg"]; diff --git a/src/Client/InternalClient.js b/src/Client/InternalClient.js index 2a785a9c4..01235b8cc 100755 --- a/src/Client/InternalClient.js +++ b/src/Client/InternalClient.js @@ -61,15 +61,15 @@ export default class InternalClient { var buckets = []; var match = url.match(/\/channels\/([0-9]+)\/messages(\/[0-9]+)?$/); if(match) { - if(this.user.bot) { + if(method === "del" && (match[1] = this.channels.get("id", match[1]))) { + buckets = ["dmsg:" + (match[1].guild ? match[1].guild.id : undefined)]; + } else if(this.user.bot) { if(method === "post" || method === "patch") { if(this.private_channels.get("id", match[1])) { buckets = ["bot:msg:dm", "bot:msg:global"]; } else if((match[1] = this.channels.get("id", match[1]))) { buckets = ["bot:msg:guild:" + match[1].id, "bot:msg:global"]; } - } else if(method === "del" && (match[1] = this.channels.get("id", match[1]))) { - buckets = ["dmsg:" + match[1].id]; } } else { buckets = ["msg"];