49 lines
1.5 KiB
JavaScript
49 lines
1.5 KiB
JavaScript
|
module.exports = {
|
||
|
name: "slowmode",
|
||
|
category: "moderation",
|
||
|
description: "Hier können Sie den Slowmode für den Kanal einstellen.",
|
||
|
args: true,
|
||
|
usage: "<time>",
|
||
|
run: (client, message, args) => {
|
||
|
const amount = parseInt(args[0]);
|
||
|
if (message.member.hasPermission("MANAGE_CHANNEL"))
|
||
|
if (isNaN(amount))
|
||
|
return message.channel.send("<a:crossWrong:It doesn't seem to be valid number");
|
||
|
if (args[0] === amount + "s") {
|
||
|
message.channel.setRateLimitPerUser(amount);
|
||
|
if (amount > 1) {
|
||
|
message.channel.send("Slowmode ist jetzt " + amount + " Sekunden");
|
||
|
return;
|
||
|
} else {
|
||
|
message.channel.send("Slowmode ist jetzt " + amount + " Sekunden");
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
if (args[0] === amount + "min") {
|
||
|
message.channel.setRateLimitPerUser(amount * 60);
|
||
|
if (amount > 1) {
|
||
|
message.channel.send("Slowmode ist jetzt " + amount + " Minuten");
|
||
|
return;
|
||
|
} else {
|
||
|
message.channel.send("Slowmode ist jetzt " + amount + " Minuten");
|
||
|
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
if (args[0] === amount + "h") {
|
||
|
message.channel.setRateLimitPerUser(amount * 60 * 60);
|
||
|
if (amount > 1) {
|
||
|
message.channel.send("Slowmode ist jetzt " + amount + " Stunden");
|
||
|
return;
|
||
|
} else {
|
||
|
message.channel.send("Slowmode ist jetzt " + amount + " Stunden");
|
||
|
return;
|
||
|
}
|
||
|
} else {
|
||
|
message.channel.send(
|
||
|
"Sie können nur Sekunden (s), Minuten (min) und Stunden (h) einstellen."
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
};
|