toowake

index.js autoreply

Aug 7th, 2023
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Autoreply
  2. client.on(Events.MessageCreate, async (message) => {
  3.   const autoreply = require("./Schemas.js/autoreply");
  4.  
  5.   const replyData = await autoreply.findOne({
  6.     Guild: message.guild.id,
  7.   })
  8.  
  9.   if (replyData) {
  10.     if (message.content.toLowerCase().includes(replyData.Keyword)) {
  11.  
  12.       await message.reply({ content: `${replyData.Reply}` });
  13.  
  14.     } else if (message.content.includes(replyData.Keyword)) {
  15.  
  16.       await message.reply({ content: `${replyData.Reply}` });
  17.  
  18.     } else if (message.content.toUpperCase().includes(replyData.Keyword)) {
  19.  
  20.       await message.reply({ content: `${replyData.Reply}` });
  21.  
  22.     }
  23.   }
  24. });
Advertisement
Add Comment
Please, Sign In to add comment