-1

I have a user info command for my bot, and am using message.author.presence.game to display what game the user is playing. Whenever they are not playing a game, it displays null. How can I make it so it displays Nothing or No game?

cyliim
  • 301
  • 1
  • 5
  • 19
  • `console.log(message.author.presence.game || 'No game');` Did you do any research before asking this question? [Explanation of logical OR](https://dev.to/banesag/javascript-logical-operators-and-boolean-values-1l07) – Xatenev Apr 07 '19 at 19:02

1 Answers1

2

Just use message.author.presence.game || "Nothing" while displaying text.

Lukas Forst
  • 802
  • 1
  • 8
  • 25