Discord.js setGame() not working anymore












3















I have been coding my Discord bot using Discord.JS for about 2 months now and I've just recently noticed that my bot isn't saying that it's playing what I'm telling it. When I first coded the bot up until recently it worked just fine. Now the 3 discord bots I have aren't showing their games.



This is the code I'm using:



const Discord = require("discord.js");
const bot = new Discord.Client();
bot.on("ready", () => {
console.log("Ready");
bot.user.setGame("Type !help");
}









share|improve this question





























    3















    I have been coding my Discord bot using Discord.JS for about 2 months now and I've just recently noticed that my bot isn't saying that it's playing what I'm telling it. When I first coded the bot up until recently it worked just fine. Now the 3 discord bots I have aren't showing their games.



    This is the code I'm using:



    const Discord = require("discord.js");
    const bot = new Discord.Client();
    bot.on("ready", () => {
    console.log("Ready");
    bot.user.setGame("Type !help");
    }









    share|improve this question



























      3












      3








      3








      I have been coding my Discord bot using Discord.JS for about 2 months now and I've just recently noticed that my bot isn't saying that it's playing what I'm telling it. When I first coded the bot up until recently it worked just fine. Now the 3 discord bots I have aren't showing their games.



      This is the code I'm using:



      const Discord = require("discord.js");
      const bot = new Discord.Client();
      bot.on("ready", () => {
      console.log("Ready");
      bot.user.setGame("Type !help");
      }









      share|improve this question
















      I have been coding my Discord bot using Discord.JS for about 2 months now and I've just recently noticed that my bot isn't saying that it's playing what I'm telling it. When I first coded the bot up until recently it worked just fine. Now the 3 discord bots I have aren't showing their games.



      This is the code I'm using:



      const Discord = require("discord.js");
      const bot = new Discord.Client();
      bot.on("ready", () => {
      console.log("Ready");
      bot.user.setGame("Type !help");
      }






      javascript node.js discord discord.js






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 16 '18 at 12:45









      André

      2,19141330




      2,19141330










      asked Aug 27 '17 at 18:18









      PMCJohnPMCJohn

      5718




      5718
























          4 Answers
          4






          active

          oldest

          votes


















          3














          .setGame() is deprecated now but you could use .setPresence() or you could use the .setActivity() which is the same thing and format as the .setGame().
          Ex.



          const Discord = require('discord.js');
          const bot = new Discord.Client();
          client.user.setActivity('YouTube', { type: 'WATCHING' });


          Here is a link to the documentation in case you wanted to change 'Watching' to something else like 'Playing'.






          share|improve this answer
























          • Thanx! But the type: part is not working for me. Help please?

            – Christoffer
            Jul 23 '18 at 21:52






          • 1





            @ChristofferHjärtström make sure you used all caps and put it in exactly how I did. Check out the documentation I put in as well for clarity.

            – NintendoZaedus
            Jul 24 '18 at 17:45



















          2














          The setGame() Method has stopped working, here's what you can do:




          • update to latest 11.1-dev or

          • use .setPresence({ game: { name: 'nameGoesHere', type: 0 } }); as a workaround instead


          Source: https://github.com/hydrabolt/discord.js/issues/1807#issuecomment-323578919






          share|improve this answer

































            2














            setGame() is now deprecated, and discord.js asks you to use setActivity().



            const Discord = require("discord.js");
            const bot = new Discord.Client();
            bot.on("ready", () => {
            console.log("Ready");
            bot.user.setActivity("Type !help");
            })


            Hope this helped.






            share|improve this answer

































              1














              Here's a short example of using the .setPresence that LW001 linked to:



              var Discord = require('discord.js');
              var bot = new Discord.Client();

              bot.on('ready', () => {
              bot.user.setStatus('available') // Can be 'available', 'idle', 'dnd', or 'invisible'
              bot.user.setPresence({
              game: {
              name: 'Type !help',
              type: 0
              }
              });
              });


              https://discord.js.org/#/docs/main/stable/class/ClientUser?scrollTo=setGame






              share|improve this answer























                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%2f45907987%2fdiscord-js-setgame-not-working-anymore%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                3














                .setGame() is deprecated now but you could use .setPresence() or you could use the .setActivity() which is the same thing and format as the .setGame().
                Ex.



                const Discord = require('discord.js');
                const bot = new Discord.Client();
                client.user.setActivity('YouTube', { type: 'WATCHING' });


                Here is a link to the documentation in case you wanted to change 'Watching' to something else like 'Playing'.






                share|improve this answer
























                • Thanx! But the type: part is not working for me. Help please?

                  – Christoffer
                  Jul 23 '18 at 21:52






                • 1





                  @ChristofferHjärtström make sure you used all caps and put it in exactly how I did. Check out the documentation I put in as well for clarity.

                  – NintendoZaedus
                  Jul 24 '18 at 17:45
















                3














                .setGame() is deprecated now but you could use .setPresence() or you could use the .setActivity() which is the same thing and format as the .setGame().
                Ex.



                const Discord = require('discord.js');
                const bot = new Discord.Client();
                client.user.setActivity('YouTube', { type: 'WATCHING' });


                Here is a link to the documentation in case you wanted to change 'Watching' to something else like 'Playing'.






                share|improve this answer
























                • Thanx! But the type: part is not working for me. Help please?

                  – Christoffer
                  Jul 23 '18 at 21:52






                • 1





                  @ChristofferHjärtström make sure you used all caps and put it in exactly how I did. Check out the documentation I put in as well for clarity.

                  – NintendoZaedus
                  Jul 24 '18 at 17:45














                3












                3








                3







                .setGame() is deprecated now but you could use .setPresence() or you could use the .setActivity() which is the same thing and format as the .setGame().
                Ex.



                const Discord = require('discord.js');
                const bot = new Discord.Client();
                client.user.setActivity('YouTube', { type: 'WATCHING' });


                Here is a link to the documentation in case you wanted to change 'Watching' to something else like 'Playing'.






                share|improve this answer













                .setGame() is deprecated now but you could use .setPresence() or you could use the .setActivity() which is the same thing and format as the .setGame().
                Ex.



                const Discord = require('discord.js');
                const bot = new Discord.Client();
                client.user.setActivity('YouTube', { type: 'WATCHING' });


                Here is a link to the documentation in case you wanted to change 'Watching' to something else like 'Playing'.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 24 '18 at 18:57









                NintendoZaedusNintendoZaedus

                152113




                152113













                • Thanx! But the type: part is not working for me. Help please?

                  – Christoffer
                  Jul 23 '18 at 21:52






                • 1





                  @ChristofferHjärtström make sure you used all caps and put it in exactly how I did. Check out the documentation I put in as well for clarity.

                  – NintendoZaedus
                  Jul 24 '18 at 17:45



















                • Thanx! But the type: part is not working for me. Help please?

                  – Christoffer
                  Jul 23 '18 at 21:52






                • 1





                  @ChristofferHjärtström make sure you used all caps and put it in exactly how I did. Check out the documentation I put in as well for clarity.

                  – NintendoZaedus
                  Jul 24 '18 at 17:45

















                Thanx! But the type: part is not working for me. Help please?

                – Christoffer
                Jul 23 '18 at 21:52





                Thanx! But the type: part is not working for me. Help please?

                – Christoffer
                Jul 23 '18 at 21:52




                1




                1





                @ChristofferHjärtström make sure you used all caps and put it in exactly how I did. Check out the documentation I put in as well for clarity.

                – NintendoZaedus
                Jul 24 '18 at 17:45





                @ChristofferHjärtström make sure you used all caps and put it in exactly how I did. Check out the documentation I put in as well for clarity.

                – NintendoZaedus
                Jul 24 '18 at 17:45













                2














                The setGame() Method has stopped working, here's what you can do:




                • update to latest 11.1-dev or

                • use .setPresence({ game: { name: 'nameGoesHere', type: 0 } }); as a workaround instead


                Source: https://github.com/hydrabolt/discord.js/issues/1807#issuecomment-323578919






                share|improve this answer






























                  2














                  The setGame() Method has stopped working, here's what you can do:




                  • update to latest 11.1-dev or

                  • use .setPresence({ game: { name: 'nameGoesHere', type: 0 } }); as a workaround instead


                  Source: https://github.com/hydrabolt/discord.js/issues/1807#issuecomment-323578919






                  share|improve this answer




























                    2












                    2








                    2







                    The setGame() Method has stopped working, here's what you can do:




                    • update to latest 11.1-dev or

                    • use .setPresence({ game: { name: 'nameGoesHere', type: 0 } }); as a workaround instead


                    Source: https://github.com/hydrabolt/discord.js/issues/1807#issuecomment-323578919






                    share|improve this answer















                    The setGame() Method has stopped working, here's what you can do:




                    • update to latest 11.1-dev or

                    • use .setPresence({ game: { name: 'nameGoesHere', type: 0 } }); as a workaround instead


                    Source: https://github.com/hydrabolt/discord.js/issues/1807#issuecomment-323578919







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Oct 17 '17 at 15:26

























                    answered Aug 27 '17 at 18:35









                    LW001LW001

                    1,52941323




                    1,52941323























                        2














                        setGame() is now deprecated, and discord.js asks you to use setActivity().



                        const Discord = require("discord.js");
                        const bot = new Discord.Client();
                        bot.on("ready", () => {
                        console.log("Ready");
                        bot.user.setActivity("Type !help");
                        })


                        Hope this helped.






                        share|improve this answer






























                          2














                          setGame() is now deprecated, and discord.js asks you to use setActivity().



                          const Discord = require("discord.js");
                          const bot = new Discord.Client();
                          bot.on("ready", () => {
                          console.log("Ready");
                          bot.user.setActivity("Type !help");
                          })


                          Hope this helped.






                          share|improve this answer




























                            2












                            2








                            2







                            setGame() is now deprecated, and discord.js asks you to use setActivity().



                            const Discord = require("discord.js");
                            const bot = new Discord.Client();
                            bot.on("ready", () => {
                            console.log("Ready");
                            bot.user.setActivity("Type !help");
                            })


                            Hope this helped.






                            share|improve this answer















                            setGame() is now deprecated, and discord.js asks you to use setActivity().



                            const Discord = require("discord.js");
                            const bot = new Discord.Client();
                            bot.on("ready", () => {
                            console.log("Ready");
                            bot.user.setActivity("Type !help");
                            })


                            Hope this helped.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Nov 23 '18 at 3:52









                            Kevin Voorn

                            63611230




                            63611230










                            answered Apr 29 '18 at 20:12









                            Pruina TempestatisPruina Tempestatis

                            153212




                            153212























                                1














                                Here's a short example of using the .setPresence that LW001 linked to:



                                var Discord = require('discord.js');
                                var bot = new Discord.Client();

                                bot.on('ready', () => {
                                bot.user.setStatus('available') // Can be 'available', 'idle', 'dnd', or 'invisible'
                                bot.user.setPresence({
                                game: {
                                name: 'Type !help',
                                type: 0
                                }
                                });
                                });


                                https://discord.js.org/#/docs/main/stable/class/ClientUser?scrollTo=setGame






                                share|improve this answer




























                                  1














                                  Here's a short example of using the .setPresence that LW001 linked to:



                                  var Discord = require('discord.js');
                                  var bot = new Discord.Client();

                                  bot.on('ready', () => {
                                  bot.user.setStatus('available') // Can be 'available', 'idle', 'dnd', or 'invisible'
                                  bot.user.setPresence({
                                  game: {
                                  name: 'Type !help',
                                  type: 0
                                  }
                                  });
                                  });


                                  https://discord.js.org/#/docs/main/stable/class/ClientUser?scrollTo=setGame






                                  share|improve this answer


























                                    1












                                    1








                                    1







                                    Here's a short example of using the .setPresence that LW001 linked to:



                                    var Discord = require('discord.js');
                                    var bot = new Discord.Client();

                                    bot.on('ready', () => {
                                    bot.user.setStatus('available') // Can be 'available', 'idle', 'dnd', or 'invisible'
                                    bot.user.setPresence({
                                    game: {
                                    name: 'Type !help',
                                    type: 0
                                    }
                                    });
                                    });


                                    https://discord.js.org/#/docs/main/stable/class/ClientUser?scrollTo=setGame






                                    share|improve this answer













                                    Here's a short example of using the .setPresence that LW001 linked to:



                                    var Discord = require('discord.js');
                                    var bot = new Discord.Client();

                                    bot.on('ready', () => {
                                    bot.user.setStatus('available') // Can be 'available', 'idle', 'dnd', or 'invisible'
                                    bot.user.setPresence({
                                    game: {
                                    name: 'Type !help',
                                    type: 0
                                    }
                                    });
                                    });


                                    https://discord.js.org/#/docs/main/stable/class/ClientUser?scrollTo=setGame







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Oct 26 '17 at 11:59









                                    koubikoubi

                                    12910




                                    12910






























                                        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%2f45907987%2fdiscord-js-setgame-not-working-anymore%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







                                        Popular posts from this blog

                                        "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

                                        Alcedinidae

                                        Origin of the phrase “under your belt”?