How to set bot activity

10,976

In discord.js, the presence can be set like this:

bot.on('ready', () => {
  bot.user.setActivity('a game', { type: 'PLAYING' })
})

Share:
10,976

Related videos on Youtube

Tobyhn
Author by

Tobyhn

Updated on June 04, 2022

Comments

  • Tobyhn
    Tobyhn almost 2 years

    I am having trouble figuring out what I must do to set a custom game activity. I have tried a few different combinations of code, but I can't seem to get it to work.

    My code:

    bot.user.setPresence({ game: { name: 'a game' }})
    
  • Cristian
    Cristian over 3 years
    I add the official documentation DiscordJs - setActivity