diff --git a/src/Bot.ts b/src/Bot.ts index 2754fa7..90595d9 100644 --- a/src/Bot.ts +++ b/src/Bot.ts @@ -5,10 +5,15 @@ import { TryCommand } from "./commands/general"; import { UrlCommand } from "./commands/link"; import onInteraction from "./events/onInteraction"; import onReady from "./events/onReady"; +import onMessageCreate from "./events/onMessageCreate"; import { Command } from "./structures/Command"; dotenv.config(); -const client = new Client({ intents: [] }); +const client = new Client({ intents: [ + 'MessageContent', + 'GuildMessages', + 'Guilds' +] }); const token = process.env.token; export const Commands: Command[] = [ @@ -17,5 +22,6 @@ export const Commands: Command[] = [ onReady(client); onInteraction(client); +onMessageCreate(client); client.login(token); diff --git a/src/events/onMessageCreate.ts b/src/events/onMessageCreate.ts new file mode 100644 index 0000000..b2831c5 --- /dev/null +++ b/src/events/onMessageCreate.ts @@ -0,0 +1,13 @@ +import { ChatInputCommandInteraction, Client, Interaction, Message } from "discord.js"; +import { Commands } from "../Bot"; +import { errorEmbed } from "../utils/EmbedUtil"; + +export default (client: Client): void => { + client.on("messageCreate", async (message: Message) => { + if (message.author.bot) return; + + if (message.content.toLowerCase().includes('folia')) { + message.reply('**This is the MultiPaper discord server.**\nFor Folia-related questions, head to the PaperMC server instead: https://discord.gg/papermc') + } + }); +}; \ No newline at end of file