mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
Fix deleteMessage ratelimiting
This commit is contained in:
@@ -131,15 +131,15 @@ var InternalClient = (function () {
|
|||||||
var buckets = [];
|
var buckets = [];
|
||||||
var match = url.match(/\/channels\/([0-9]+)\/messages(\/[0-9]+)?$/);
|
var match = url.match(/\/channels\/([0-9]+)\/messages(\/[0-9]+)?$/);
|
||||||
if (match) {
|
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 (method === "post" || method === "patch") {
|
||||||
if (this.private_channels.get("id", match[1])) {
|
if (this.private_channels.get("id", match[1])) {
|
||||||
buckets = ["bot:msg:dm", "bot:msg:global"];
|
buckets = ["bot:msg:dm", "bot:msg:global"];
|
||||||
} else if (match[1] = this.channels.get("id", match[1])) {
|
} else if (match[1] = this.channels.get("id", match[1])) {
|
||||||
buckets = ["bot:msg:guild:" + match[1].id, "bot:msg:global"];
|
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 {
|
} else {
|
||||||
buckets = ["msg"];
|
buckets = ["msg"];
|
||||||
|
|||||||
@@ -61,15 +61,15 @@ export default class InternalClient {
|
|||||||
var buckets = [];
|
var buckets = [];
|
||||||
var match = url.match(/\/channels\/([0-9]+)\/messages(\/[0-9]+)?$/);
|
var match = url.match(/\/channels\/([0-9]+)\/messages(\/[0-9]+)?$/);
|
||||||
if(match) {
|
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(method === "post" || method === "patch") {
|
||||||
if(this.private_channels.get("id", match[1])) {
|
if(this.private_channels.get("id", match[1])) {
|
||||||
buckets = ["bot:msg:dm", "bot:msg:global"];
|
buckets = ["bot:msg:dm", "bot:msg:global"];
|
||||||
} else if((match[1] = this.channels.get("id", match[1]))) {
|
} else if((match[1] = this.channels.get("id", match[1]))) {
|
||||||
buckets = ["bot:msg:guild:" + match[1].id, "bot:msg:global"];
|
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 {
|
} else {
|
||||||
buckets = ["msg"];
|
buckets = ["msg"];
|
||||||
|
|||||||
Reference in New Issue
Block a user