Here is a possible solution:
- Make array of the presence action alone.
var word = ["the world", "with a cat"];
- Check what
word[i]
is and make presence accordingly.
if (word[i] === "the world") {
let action = "{ type: 'WATCHING' }";
client.user.setActivity(args[i], JSON.parse(action));
} else if (word[i] === "with a cat") {
let action = "{ type: 'PLAYING' }";
client.user.setActivity(args[i], JSON.parse(action));
} else {
// something else
}