N
N
not important .2020-11-08 14:43:08
Node.js
not important ., 2020-11-08 14:43:08

The problem is in presence.status, what's wrong?

Status is not working for me
here is the code:

let embed = new Discord.MessageEmbed() 
        .setTitle(message.author.tag) // в тайтле имя автора 
        let status = ''
        switch (message.author.presence.status) { 
        case 'online':
            status = 'онлайн :green_circle:'; break;   
            case 'idle':
                status = 'нет на месте :orange_circle:'; break;
                case 'offline':
                   status = 'нет в сети :black_circle:'; break;
                    case 'dnd':
                        status = 'не беспокоить :red_circle:'; break;
        }
        embed.setDescription(`**Ваш дискорд айди: **${message.author.id}
        **Ваш статус: **${status}
        **Дата создания аккаунта: **${message.author.createdAt.toLocaleDateString()}
        **Дата входа на сервер: **${message.member.joinedAt.toLocaleDateString()}
        `)
        .setColor('BLACK')
        .setThumbnail(message.author.avatarURL()) 
        message.channel.send(embed) /

the idea is that when you write !profile, the discord bot should issue an embed message with your data, but the line where it says "status" always says "offline" and it does not depend on whether you are online or not, please help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Weishaypt, 2020-11-08
@26DiDi12

Discord recently decided to change the API. And now, to get the status of users in the bot settings on the developer portal, you need to enable the Presence Intent option .
5fa80ef284fa1759290472.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question