No longer complains about ratelimits randomly

This commit is contained in:
Emily 2020-03-03 02:01:40 +00:00 committed by GitHub
parent 0fc8b2bd66
commit 7c6921b844
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -131,13 +131,6 @@ module.exports = async (client, message) => {
}; };
}; };
if (commandRanRecently.has(message.author.id)) {
return message.channel.send(
`<:wait:467115775849922570> You are being ratelimited. Please try again in 2 seconds.`
)
.then(m => m.delete(2000));
};
const prefixMention = new RegExp(`^<@!?${client.user.id}>( |)$`); const prefixMention = new RegExp(`^<@!?${client.user.id}>( |)$`);
if (message.content.match(prefixMention)) { if (message.content.match(prefixMention)) {
@ -152,6 +145,13 @@ module.exports = async (client, message) => {
if (!cmd) return; if (!cmd) return;
if (commandRanRecently.has(message.author.id)) {
return message.channel.send(
`<:wait:467115775849922570> You are being ratelimited. Please try again in 2 seconds.`
)
.then(m => m.delete(2000));
};
if (!perms.has('SEND_MESSAGES')) { if (!perms.has('SEND_MESSAGES')) {
return message.author.send(`<:error:466995152976871434> I don't have permission to speak in **#${message.channel.name}**, Please ask a moderator to give me the send messages permission!`); return message.author.send(`<:error:466995152976871434> I don't have permission to speak in **#${message.channel.name}**, Please ask a moderator to give me the send messages permission!`);
}; };