Beautifying

This commit is contained in:
2023-04-24 23:38:33 +02:00
parent e2747dab3f
commit 3a3bb89635
40 changed files with 4010 additions and 3388 deletions

View File

@@ -1,59 +1,64 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
const { color } = require('../config/options.json');
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js");
const { color } = require("../config/options.json");
module.exports = {
name: 'slowmode',
description: 'Set the slowmode of a channel.',
type: 'slash',
name: "slowmode",
description: "Set the slowmode of a channel.",
type: "slash",
data: new SlashCommandBuilder()
.setName('slowmode')
.setDescription('Set the slowmode of a channel.')
.addIntegerOption(option =>
option
.setName('seconds')
.setDescription('The amount of seconds to set the slowmode to.'))
.addChannelOption(option =>
option
.setName('channel')
.setDescription('The channel to set the slowmode of.'))
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
data: new SlashCommandBuilder()
.setName("slowmode")
.setDescription("Set the slowmode of a channel.")
.addIntegerOption((option) =>
option
.setName("seconds")
.setDescription("The amount of seconds to set the slowmode to.")
)
.addChannelOption((option) =>
option
.setName("channel")
.setDescription("The channel to set the slowmode of.")
)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction) {
async execute(interaction) {
await interaction.deferReply({ ephermeral: true });
await interaction.deferReply({ ephermeral: true });
const seconds = interaction.options.getInteger('seconds') ?? 5
const channel = interaction.options.getChannel('channel') ?? interaction.channel
const embedColor = Number(color.replace("#", "0x"));
if (seconds > 21600) {
await channel.setRateLimitPerUser(21600)
await interaction.editReply({
embeds: [{
description: `Set the slowmode of ${channel} to 21600 seconds.`,
color: embedColor,
footer: {
text: interaction.guild.name + " | Developed by: @Taken#0001",
icon_url: interaction.guild.iconURL({ dynamic: true })
}
}]
})
return
}
await interaction.editReply({
embeds: [{
description: `Set the slowmode of ${channel} to ${seconds} seconds.`,
color: embedColor,
footer: {
text: interaction.guild.name + " | Developed by: @Taken#0001",
icon_url: interaction.guild.iconURL({ dynamic: true })
}
}]
})
await channel.setRateLimitPerUser(seconds)
const seconds = interaction.options.getInteger("seconds") ?? 5;
const channel =
interaction.options.getChannel("channel") ?? interaction.channel;
const embedColor = Number(color.replace("#", "0x"));
if (seconds > 21600) {
await channel.setRateLimitPerUser(21600);
await interaction.editReply({
embeds: [
{
description: `Set the slowmode of ${channel} to 21600 seconds.`,
color: embedColor,
footer: {
text: interaction.guild.name + " | Developed by: @Taken#0001",
icon_url: interaction.guild.iconURL({ dynamic: true })
}
}
]
});
return;
}
}
await interaction.editReply({
embeds: [
{
description: `Set the slowmode of ${channel} to ${seconds} seconds.`,
color: embedColor,
footer: {
text: interaction.guild.name + " | Developed by: @Taken#0001",
icon_url: interaction.guild.iconURL({ dynamic: true })
}
}
]
});
await channel.setRateLimitPerUser(seconds);
}
};