toowake

pastebin

Nov 4th, 2023
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const broSchema = require("./Schemas.js/brocount")
  2.  
  3. client.on("messageCreate", async (message) => {
  4.     const { author, content } = message;
  5.  
  6.     const dataBro = await broSchema.findOne({
  7.         User: author.id,
  8.     })
  9.  
  10.     if (content.includes("Bro") || content.includes("bro")) {
  11.         if (dataBro) {
  12.             dataBro.Count++;
  13.             dataBro.save();
  14.         } else {
  15.             await broSchema.create({
  16.                 User: author.id,
  17.                 Count: 1,
  18.             })
  19.         }
  20.     } else {
  21.         return;
  22.     }
  23. })
Advertisement
Add Comment
Please, Sign In to add comment