Fix deleteMessage ratelimiting

This commit is contained in:
abalabahaha
2016-07-29 06:48:42 +09:00
parent d956780d18
commit 41dab17ec0
2 changed files with 6 additions and 6 deletions

View File

@@ -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"];

View File

@@ -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"];