Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
- const Discord = require('discord.js');
- module.exports = {
- data: new SlashCommandBuilder()
- .setName('slow-mode')
- .setDescription('Just Shut The F*ck Up Chat, Stop Spamming')
- .addStringOption(option =>
- option.setName('input').setDescription('Add Time Exmple: 10 (Max Seconds: 21600)').setRequired(true)),
- async execute(interaction) {
- if (!interaction.member.permissions.has(PermissionFlagsBits.ManageChannels)) {
- return interaction.reply({ content: 'You Need The `MANAGE_CHANNELS` Permission To Slow The Messages.' });
- }
- if (!interaction.guild.members.me.permissions.has(PermissionFlagsBits.ManageChannels)) {
- return interaction.reply({ content: 'I Need The `MANAGE_CHANNELS` Permission To Slow The Messages.' });
- }
- let slowmode = interaction.options.getString('input')
- interaction.channel.setRateLimitPerUser(slowmode).catch(() => {
- interaction.reply({ content: "Failed to set slowmode in this channel, check your slowmode length." })
- })
- let embed = new Discord.EmbedBuilder().setTitle(`JUST SHUT THE F*CK UP`)
- .setDescription(`**I have set the slowmode in ${interaction.channel.name} to ${slowmode} seconds! \nGo [Here](https://convertlive.com/u/convert/seconds/to/minutes 'Convert Live') To Convert These Seconds To Minutes**`)
- .setColor("#2F3136")
- return interaction.reply({ embeds: [embed] }).catch((e) => console.log(e));
- },
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement