0

Недавно начал писать бота для Discord и параллельно изучать Discord.JS. Постоянно вижу ботов с статусом "Играет в /help" или "Смотрит за N серверов"


Так вот, как это сделать на Discord.JS 12.2.0?!

1

2 ответа 2

0

Вы можете использовать метод setPresence

const Discord = require('discord.js');
const client = new Discord.Client();
const prefix = '?';
const token = require('./token.json').token;

client.on('ready', () => {
    console.log(`Bot is ready`);
    client.user.setPresence({
        status: 'online',
        activity: {
            type: 'WATCHING',
            name: '/help',
        },
    });
});
0

играет в "/help":

bot.user.setPresence({
    game: {
        name: `Играет в ${prefix}help`,
        type: "PLAYING",
    }
});

смотрит за N серверами:

    bot.user.setPresence({
        game: {
            name: `${bot.guilds.cache.size} серверов`,
            type: "WATCHING",
        }
    });
});

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.