25 lines
885 B
JavaScript
Executable File
25 lines
885 B
JavaScript
Executable File
const { SlashCommandBuilder } = require('discord.js')
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName('spam')
|
|
.setDescription('Spam')
|
|
.addUserOption(option => option.setName('user').setDescription('Spam').setRequired(true))
|
|
.addStringOption(option => option.setName('string').setDescription('Spam').setRequired(true))
|
|
.addIntegerOption(option => option.setName('integer').setDescription('Spam').setRequired(true)),
|
|
async execute(interaction) {
|
|
let user = interaction.options.getUser('user')
|
|
let string = interaction.options.getString('string')
|
|
let integer = interaction.options.getInteger('integer')
|
|
await interaction.reply({ content: 'Spam', ephemeral: true })
|
|
let i = 0
|
|
function myLoop() {
|
|
setTimeout(function () {
|
|
user.send(string).catch(error => console.error(error))
|
|
i++
|
|
if (i < integer) myLoop()
|
|
}, 1000)
|
|
}
|
|
myLoop()
|
|
}
|
|
} |