title: No overload matches this call Discord.js MessageComponentCollector
body: <p>I'm trying to code a tictactoe command for my Discord bot in TypeScript. I want that if someone other than the current turn's player interact with the buttons, it simply returns a reply. <br>
  The problem is that in the <code>collector.on(&quot;collect&quot;)</code> event if I put a return, the compiler gives this error:</p>
  <pre><code>No overload matches this call.
    Overload 1 of 3, '(event: &quot;end&quot;, listener: (collected: Collection&lt;string, MessageComponentInteraction&lt;CacheType&gt;&gt;, reason: string) =&gt; Awaitable&lt;void&gt;): InteractionCollector&lt;...&gt;', gave the following error.
      Argument of type '&quot;collect&quot;' is not assignable to parameter of type '&quot;end&quot;'.
    Overload 2 of 3, '(event: &quot;dispose&quot; | &quot;collect&quot;, listener: (interaction: MessageComponentInteraction&lt;CacheType&gt;) =&gt; Awaitable&lt;void&gt;): InteractionCollector&lt;...&gt;', gave the following error.
  </code></pre>
  <p>and others very similar to this, but too long to write here.
  The question is, what does this mean? And what can I do to avoid the problem? Thank you! Full code: <br></p>
  <pre><code>import { MessageActionRow, MessageButton, MessageComponentInteraction } from &quot;discord.js&quot;;
  import { Command } from &quot;../../structures/Command&quot;;
  
  export default new Command({
      name: &quot;tictactoe&quot;,
      description: &quot;Play a game of tic tac toe with another user!&quot;,
      options: [
          {
              name: &quot;user&quot;,
              description: &quot;The user you want to play with.&quot;,
              type: &quot;USER&quot;,
              required: true,
          },
      ],
  
      run: async({ interaction }) =&gt; {
  
          const user = interaction.options.get(&quot;user&quot;).user;
  
          const players: Array&lt;string&gt; = [
              interaction.user.username,
              user.username
          ];
  
          const first_row: MessageActionRow = new MessageActionRow();
          const second_row: MessageActionRow = new MessageActionRow();
          const third_row: MessageActionRow = new MessageActionRow();
  
          for (let i = 1; i &lt;= 9; i++) {
              if (i &lt;= 3) {
                  first_row.addComponents(
                      new MessageButton().setCustomId(String(i)).setLabel(&quot; &quot;).setStyle(&quot;SECONDARY&quot;)
                  );
              } else if (i &lt;= 6) {
                  second_row.addComponents(
                      new MessageButton().setCustomId(String(i)).setLabel(&quot; &quot;).setStyle(&quot;SECONDARY&quot;)
                  );
              } else {
                  third_row.addComponents(
                      new MessageButton().setCustomId(String(i)).setLabel(&quot; &quot;).setStyle(&quot;SECONDARY&quot;)
                  );
              }
          }
  
          interaction.editReply({
              content: `**${players[0]} : X**\n**${players[1]} : O**`,
              components: [first_row, second_row, third_row],
          });
  
          const filter = (i: MessageComponentInteraction) =&gt; i.user.id == interaction.user.id || i.user.id == user.id;
          const collector = interaction.channel.createMessageComponentCollector({ filter, time: 60000, max: 9 });
  
          let now: number = 0;
  
          collector.on(&quot;collect&quot;, async i =&gt; {
              await i.deferUpdate();
  
              if (i.user.username == players[now]) return i.editReply(`${players[now]} this is not your turn!`);
  
              const index: string = i.customId;
              
              for (let i = 0; i &lt;= 9; i++) {
                  if (String(i) == index) {
                      if (i &lt;= 3) {
                          (first_row.components[i - 1] as MessageButton).setStyle(&quot;SUCCESS&quot;);
                      } else if (i &lt;= 6) {
                          (second_row.components[i - 4] as MessageButton).setStyle(&quot;SUCCESS&quot;);
                      } else {
                          (third_row.components[i - 7] as MessageButton).setStyle(&quot;SUCCESS&quot;);
                      }
                  }
              }
  
              i.editReply({
                  content: `**${players[0]} : X**\n**${players[1]} : O**`,
                  components: [first_row, second_row, third_row],
              });
          });
      }
  });
  </code></pre>