Advertisement
tomtomvader298

Where To Start?...

Dec 4th, 2022
520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
  2. const Discord = require('discord.js');
  3.  
  4. module.exports = {
  5.     data: new SlashCommandBuilder()
  6.         .setName('slow-mode')
  7.         .setDescription('Just Shut The F*ck Up Chat, Stop Spamming')
  8.         .addStringOption(option =>
  9.             option.setName('input').setDescription('Add Time Exmple: 10 (Max Seconds: 21600)').setRequired(true)),
  10.     async execute(interaction) {
  11.  
  12.         if (!interaction.member.permissions.has(PermissionFlagsBits.ManageChannels)) {
  13.             return interaction.reply({ content: 'You Need The `MANAGE_CHANNELS` Permission To Slow The Messages.' });
  14.         }
  15.         if (!interaction.guild.members.me.permissions.has(PermissionFlagsBits.ManageChannels)) {
  16.             return interaction.reply({ content: 'I Need The `MANAGE_CHANNELS` Permission To Slow The Messages.' });
  17.         }
  18.         let slowmode = interaction.options.getString('input')
  19.         interaction.channel.setRateLimitPerUser(slowmode).catch(() => {
  20.             interaction.reply({ content: "Failed to set slowmode in this channel, check your slowmode length." })
  21.         })
  22.  
  23.         let embed = new Discord.EmbedBuilder().setTitle(`JUST SHUT THE F*CK UP`)
  24.             .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**`)
  25.             .setColor("#2F3136")
  26.         return interaction.reply({ embeds: [embed] }).catch((e) => console.log(e));
  27.     },
  28. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement