title: bot send msg when someone speaks
body: <p>I have another question concerning my catch cmd. If I wanted to make it so that it was no longer an activable command but instead had a small chance of triggering when anyone speaks ever, how would I go about that? Would I need to put it in my message.js file? I know if I put it there as is it will trigger every time someone uses a command. However, I don't want it limited to someone using a command and I don't want it to happen every time. I've also heard of putting it in a separate json file and linking it back somehow. Any help is appreciated.</p>
  <pre><code>const profileModel = require(&quot;../models/profileSchema&quot;);
  
  module.exports = {
      name: &quot;catch&quot;,
      description: &quot;users must type catch first to catch the animal&quot;,
      async execute(client, message, msg, args, cmd, Discord, profileData) {
          
          const prey = [
              &quot;rabbit&quot;,
              &quot;rat&quot;,
              &quot;bird&quot;,
          ];
  
          const caught = [
              &quot;catch&quot;,
          ];
  
          const chosenPrey = prey.sort(() =&gt; Math.random() - Math.random()).slice(0, 1);
  
          const whenCaught = caught.sort(() =&gt; Math.random() - Math.random()).slice(0, 1);
  
          const filter = ({ content }) =&gt; whenCaught.some((caught) =&gt; caught.toLowerCase() == content.toLowerCase());
  
          const collector = message.channel.createMessageCollector({ max: 1, filter, time: 15000 });
  
          const earnings = Math.floor(Math.random() * (20 - 5 + 1)) + 5;
  
          collector.on('collect', async (m) =&gt; {
              if(m.content?.toLowerCase() === 'catch') {
                             
                  const user = m.author;
                  const userData = await profileModel.findOne({ userID: user.id });
                  
                  message.channel.send(`${userData.name} caught the ${chosenPrey}! You gained ${earnings} coins.`);
              }
  
              await profileModel.findOneAndUpdate(
                  {
                      userID: m.author.id,
                  },
                  {
                      $inc: {
                          coins: earnings,
                      },
                  }
              );
          });
  
          collector.on('end', (collected, reason) =&gt; {
              if (reason == &quot;time&quot;) {
                  message.channel.send('Too slow');
              }
          });
  
          message.channel.send(`Look out, a ${chosenPrey}! Type CATCH before it gets away!`);
      }
  }
  </code></pre>
  <p>message.js file just in case</p>
  <pre><code>const profileModel = require(&quot;../../models/profileSchema&quot;);
  
  const cooldowns = new Map();
  module.exports = async (Discord, client, message) =&gt; {
  
      let profileData;
      try {
          profileData = await profileModel.findOne({ userID: message.author.id });
          if(!profileData){
              let profile = await profileModel.create({
                  name: message.member.user.tag,
                  userID: message.author.id, 
                  serverID: message.guild.id, 
                  coins: 0,
              });
              profile.save();
          }
      } catch (err) {
        console.log(err);
      }
      
      const prefix = '-';
      if(!message.content.startsWith(prefix) || message.author.bot) return;
  
      const args = message.content.slice(prefix.length).split(/ +/);
      const cmd = args.shift().toLowerCase();
  
      const command = client.commands.get(cmd) || client.commands.find(a =&gt; a.aliases &amp;&amp; a.aliases.includes(cmd));
      if(!command) return;
  
      if(!cooldowns.has(command.name)){
          cooldowns.set(command.name, new Discord.Collection());
      }
  
      const current_time = Date.now();
      const time_stamps = cooldowns.get(command.name);
      const cooldown_amount = (command.cooldown) * 1000;
  
      if(time_stamps.has(message.author.id)){
          const expiration_time = time_stamps.get(message.author.id) + cooldown_amount;
  
          if(current_time &lt; expiration_time){
              const time_left = (expiration_time - current_time) / 1000;
              return message.reply(`Slow down there! You have to wait ${time_left.toFixed(0)} seconds before you can perform ${command.name} again.`);
          }
      }
  
      if(command) command.execute(client, message, args, cmd, Discord, profileData);
  }  
  </code></pre>