(node:10124) DeprecationWarning: Collection#find: pass a function instead












0















when i execute !x command it says



(node:10124) DeprecationWarning: Collection#find: pass a function instead



(node:10124) DeprecationWarning: Collection#find: pass a function instead



the issue is at ...let channe.. ..downchan... as the console log says



exports.startScrim = function(guild,host,type,time){
const embed = new RichEmbed()
.setColor(0x91bbff)
.addField("message x","another message"+exports.one(time),false)
.addField("Mode",type.toUpperCase(),true)
.addField("Host",host,true)
.addField("Instructions","message x",false)



let channel = guild.channels.find("name",guilds[guild.id].digitchan);
let channel2 = guild.channels.find("name",guilds[guild.id].countdownchan);
if (channel && channel2) {
channel.send(embed)`


and the next line channel.send(embed) is not even executing. help!










share|improve this question



























    0















    when i execute !x command it says



    (node:10124) DeprecationWarning: Collection#find: pass a function instead



    (node:10124) DeprecationWarning: Collection#find: pass a function instead



    the issue is at ...let channe.. ..downchan... as the console log says



    exports.startScrim = function(guild,host,type,time){
    const embed = new RichEmbed()
    .setColor(0x91bbff)
    .addField("message x","another message"+exports.one(time),false)
    .addField("Mode",type.toUpperCase(),true)
    .addField("Host",host,true)
    .addField("Instructions","message x",false)



    let channel = guild.channels.find("name",guilds[guild.id].digitchan);
    let channel2 = guild.channels.find("name",guilds[guild.id].countdownchan);
    if (channel && channel2) {
    channel.send(embed)`


    and the next line channel.send(embed) is not even executing. help!










    share|improve this question

























      0












      0








      0








      when i execute !x command it says



      (node:10124) DeprecationWarning: Collection#find: pass a function instead



      (node:10124) DeprecationWarning: Collection#find: pass a function instead



      the issue is at ...let channe.. ..downchan... as the console log says



      exports.startScrim = function(guild,host,type,time){
      const embed = new RichEmbed()
      .setColor(0x91bbff)
      .addField("message x","another message"+exports.one(time),false)
      .addField("Mode",type.toUpperCase(),true)
      .addField("Host",host,true)
      .addField("Instructions","message x",false)



      let channel = guild.channels.find("name",guilds[guild.id].digitchan);
      let channel2 = guild.channels.find("name",guilds[guild.id].countdownchan);
      if (channel && channel2) {
      channel.send(embed)`


      and the next line channel.send(embed) is not even executing. help!










      share|improve this question














      when i execute !x command it says



      (node:10124) DeprecationWarning: Collection#find: pass a function instead



      (node:10124) DeprecationWarning: Collection#find: pass a function instead



      the issue is at ...let channe.. ..downchan... as the console log says



      exports.startScrim = function(guild,host,type,time){
      const embed = new RichEmbed()
      .setColor(0x91bbff)
      .addField("message x","another message"+exports.one(time),false)
      .addField("Mode",type.toUpperCase(),true)
      .addField("Host",host,true)
      .addField("Instructions","message x",false)



      let channel = guild.channels.find("name",guilds[guild.id].digitchan);
      let channel2 = guild.channels.find("name",guilds[guild.id].countdownchan);
      if (channel && channel2) {
      channel.send(embed)`


      and the next line channel.send(embed) is not even executing. help!







      discord.js






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 21 '18 at 22:48









      AuguxAugux

      235




      235
























          1 Answer
          1






          active

          oldest

          votes


















          0














          This looks like a duplicate of:
          Collection#find: pass a function instead



          Sounds like you need to do:



          let channel = guild.channels.find(channel => channel.name === guilds[guild.id].digitchan);
          let channel2 = guild.channels.find(channel => channel.name === guilds[guild.id].countdownchan);





          share|improve this answer
























          • thank you so much! but now there are no errors showing but still not executing the rest of the script

            – Augux
            Nov 21 '18 at 23:10











          • I would assume that either channel or channel2 are not set. You're requiring that you find both of them before you move on to your next code. Are you sure that both of your finds are actually finding a channel?

            – Nate
            Nov 21 '18 at 23:11











          • can i open a new question with more information?

            – Augux
            Nov 21 '18 at 23:15











          • Go for it! If you feel like this question is answered, you should click the check mark icon by my answer, to accept it as the answer to the question.

            – Nate
            Nov 21 '18 at 23:15











          • i got the 90 minutes cooldown :/

            – Augux
            Nov 21 '18 at 23:32











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53421507%2fnode10124-deprecationwarning-collectionfind-pass-a-function-instead%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          This looks like a duplicate of:
          Collection#find: pass a function instead



          Sounds like you need to do:



          let channel = guild.channels.find(channel => channel.name === guilds[guild.id].digitchan);
          let channel2 = guild.channels.find(channel => channel.name === guilds[guild.id].countdownchan);





          share|improve this answer
























          • thank you so much! but now there are no errors showing but still not executing the rest of the script

            – Augux
            Nov 21 '18 at 23:10











          • I would assume that either channel or channel2 are not set. You're requiring that you find both of them before you move on to your next code. Are you sure that both of your finds are actually finding a channel?

            – Nate
            Nov 21 '18 at 23:11











          • can i open a new question with more information?

            – Augux
            Nov 21 '18 at 23:15











          • Go for it! If you feel like this question is answered, you should click the check mark icon by my answer, to accept it as the answer to the question.

            – Nate
            Nov 21 '18 at 23:15











          • i got the 90 minutes cooldown :/

            – Augux
            Nov 21 '18 at 23:32
















          0














          This looks like a duplicate of:
          Collection#find: pass a function instead



          Sounds like you need to do:



          let channel = guild.channels.find(channel => channel.name === guilds[guild.id].digitchan);
          let channel2 = guild.channels.find(channel => channel.name === guilds[guild.id].countdownchan);





          share|improve this answer
























          • thank you so much! but now there are no errors showing but still not executing the rest of the script

            – Augux
            Nov 21 '18 at 23:10











          • I would assume that either channel or channel2 are not set. You're requiring that you find both of them before you move on to your next code. Are you sure that both of your finds are actually finding a channel?

            – Nate
            Nov 21 '18 at 23:11











          • can i open a new question with more information?

            – Augux
            Nov 21 '18 at 23:15











          • Go for it! If you feel like this question is answered, you should click the check mark icon by my answer, to accept it as the answer to the question.

            – Nate
            Nov 21 '18 at 23:15











          • i got the 90 minutes cooldown :/

            – Augux
            Nov 21 '18 at 23:32














          0












          0








          0







          This looks like a duplicate of:
          Collection#find: pass a function instead



          Sounds like you need to do:



          let channel = guild.channels.find(channel => channel.name === guilds[guild.id].digitchan);
          let channel2 = guild.channels.find(channel => channel.name === guilds[guild.id].countdownchan);





          share|improve this answer













          This looks like a duplicate of:
          Collection#find: pass a function instead



          Sounds like you need to do:



          let channel = guild.channels.find(channel => channel.name === guilds[guild.id].digitchan);
          let channel2 = guild.channels.find(channel => channel.name === guilds[guild.id].countdownchan);






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 21 '18 at 23:00









          NateNate

          1,476212




          1,476212













          • thank you so much! but now there are no errors showing but still not executing the rest of the script

            – Augux
            Nov 21 '18 at 23:10











          • I would assume that either channel or channel2 are not set. You're requiring that you find both of them before you move on to your next code. Are you sure that both of your finds are actually finding a channel?

            – Nate
            Nov 21 '18 at 23:11











          • can i open a new question with more information?

            – Augux
            Nov 21 '18 at 23:15











          • Go for it! If you feel like this question is answered, you should click the check mark icon by my answer, to accept it as the answer to the question.

            – Nate
            Nov 21 '18 at 23:15











          • i got the 90 minutes cooldown :/

            – Augux
            Nov 21 '18 at 23:32



















          • thank you so much! but now there are no errors showing but still not executing the rest of the script

            – Augux
            Nov 21 '18 at 23:10











          • I would assume that either channel or channel2 are not set. You're requiring that you find both of them before you move on to your next code. Are you sure that both of your finds are actually finding a channel?

            – Nate
            Nov 21 '18 at 23:11











          • can i open a new question with more information?

            – Augux
            Nov 21 '18 at 23:15











          • Go for it! If you feel like this question is answered, you should click the check mark icon by my answer, to accept it as the answer to the question.

            – Nate
            Nov 21 '18 at 23:15











          • i got the 90 minutes cooldown :/

            – Augux
            Nov 21 '18 at 23:32

















          thank you so much! but now there are no errors showing but still not executing the rest of the script

          – Augux
          Nov 21 '18 at 23:10





          thank you so much! but now there are no errors showing but still not executing the rest of the script

          – Augux
          Nov 21 '18 at 23:10













          I would assume that either channel or channel2 are not set. You're requiring that you find both of them before you move on to your next code. Are you sure that both of your finds are actually finding a channel?

          – Nate
          Nov 21 '18 at 23:11





          I would assume that either channel or channel2 are not set. You're requiring that you find both of them before you move on to your next code. Are you sure that both of your finds are actually finding a channel?

          – Nate
          Nov 21 '18 at 23:11













          can i open a new question with more information?

          – Augux
          Nov 21 '18 at 23:15





          can i open a new question with more information?

          – Augux
          Nov 21 '18 at 23:15













          Go for it! If you feel like this question is answered, you should click the check mark icon by my answer, to accept it as the answer to the question.

          – Nate
          Nov 21 '18 at 23:15





          Go for it! If you feel like this question is answered, you should click the check mark icon by my answer, to accept it as the answer to the question.

          – Nate
          Nov 21 '18 at 23:15













          i got the 90 minutes cooldown :/

          – Augux
          Nov 21 '18 at 23:32





          i got the 90 minutes cooldown :/

          – Augux
          Nov 21 '18 at 23:32




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53421507%2fnode10124-deprecationwarning-collectionfind-pass-a-function-instead%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Xamarin.form Move up view when keyboard appear

          Post-Redirect-Get with Spring WebFlux and Thymeleaf

          Anylogic : not able to use stopDelay()