set status command doesn't set status

Viewed 108

This should change the status and activity but for some reason, it only changes the status not the activity.

const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();

if (command == "status") {
    if (!args[2]) {
        return message.channel.send({ content: "Usuage: {prefix}{command} {online/idle etc} {type} {status}" });
    }

    client.user.setPresence({
        status: `${args[0]}`,
        activities: [{ type: `${args[1]}`, name: `${args.slice(2).join(" ")}` }],
    });
}
1 Answers

If you're using v12:

if(!args[2]){ return message.channel.send({ content: 'Usuage: {prefix}{command} {online/idle etc} {type} {status}' }) }

client.user.setPresence({
  status: `${args[0]}`,
  activity: { type: `${args[1].toUpperCase()}`, name: `${args.slice(2).join(' ')}` }
});

And if you're using v13:

if(!args[2]){ return message.channel.send({ content: 'Usuage: {prefix}{command} {online/idle etc} {type} {status}' }) }

client.user.setPresence({
  status: `${args[0]}`,
  activities: [{ type: `${args[1].toUpperCase()}`, name: `${args.slice(2).join(' ')}` }]
}); 

Make sure that args[1] is in caps (e.g: PLAYING, WATCHING)
Note that bots cannot set a CUSTOM activity type, it is only for custom statuses received from users

Related