slowmode works now yay
This commit is contained in:
parent
fcc56c3b56
commit
884ee35fa1
1 changed files with 11 additions and 3 deletions
|
@ -1,8 +1,16 @@
|
|||
exports.run = async (client, message, args, level) => {
|
||||
let rateLimit = +args[0] || 0;
|
||||
message.delete();
|
||||
let rateLimit = +args[0];
|
||||
|
||||
if(typeof rateLimit !== "number") return (await message.reply("you need to provide a valid time limit!")).delete(5000);
|
||||
if(rateLimit < 0 || rateLimit > 21600) return (await message.reply(`I can't complete this request because the Discord API is only able to handle times from 0 seconds to 21600 seconds (6 hours), and you requested a time of ${rateLimit} seconds.`)).delete(5000);
|
||||
|
||||
message.channel.rateLimitPerUser = rateLimit;
|
||||
(await message.channel.send(`${message.author} has set ${message.channel}'s slowmode to ${rateLimit} seconds.`)).delete(5000);
|
||||
message.channel.setRateLimitPerUser(rateLimit, `command handle from ${message.author.tag}.`);
|
||||
if(rateLimit === 0) {
|
||||
(await message.channel.send(`${message.author} has removed ${message.channel}'s slowmode.`)).delete(5000);
|
||||
} else {
|
||||
(await message.channel.send(`${message.author} has set ${message.channel}'s slowmode to ${rateLimit} seconds.`)).delete(5000);
|
||||
}
|
||||
};
|
||||
|
||||
exports.conf = {
|
||||
|
|
Loading…
Reference in a new issue