Discord.js setGame() not working anymore

后端 未结 4 1527
-上瘾入骨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:44

    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

提交回复
热议问题