require('dotenv').config(); const Discord = require('discord.js'); const client = new Discord.Client({ intents: ["GUILDS", "GUILD_MESSAGES"] }); const slashcommands = require('./config/slash.json'); const authors = require('./config/authors.json'); client.on("ready", () => { console.log(`Running at ${client.user.tag}!`); }); client.on("messageCreate", async message => { if (message.author.bot) return; if (authors.includes(message.author.tag) && message.content.toLowerCase === "!deploy") { client.application.commands.set(slashcommands); } if (message.content.toLowerCase().includes("-ass ")) { const rearrangedMessage = message.content.toLowerCase().replace(/\-ass\ /g, " ass-"); message.delete(); message.channel.createWebhook(message.author.username, { avatar: message.author.displayAvatarURL() }) .then(async webhook => { await webhook.send({ content: rearrangedMessage }); await webhook.delete(); }) } }); client.login(process.env.TOKEN);