Discord.js setGame() not working anymore

后端 未结 4 1529
-上瘾入骨i
-上瘾入骨i 2021-01-19 23:20

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.

4条回答
  •  天涯浪人
    2021-01-19 23:35

    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.

提交回复
热议问题