【问题标题】:discordjs this code isn't setting my bot's activitydiscordjs 这段代码没有设置我的机器人的活动
【发布时间】:2020-09-13 23:10:03
【问题描述】:

我想知道为什么下面的代码没有改变我的机器人的活动。我运行我的机器人,只有状态发生变化,控制台记录机器人在线。我的机器人显示为:https://gyazo.com/9def3dad8fa388032d9f33b9e3b14de7

有什么想法吗?

bot.on('ready', ()=>{
    bot.user.setActivity('Chillzone', {type: 'WATCHING'})
    bot.user.setStatus('idle')
    console.log('This bot is online')
});

【问题讨论】:

标签: discord.js


【解决方案1】:

不妨试试这样的:

bot.on("ready", () => {
  console.log(`I'm ready!`);
  bot.user
    .setPresence({
      activity: { name: 'Chillzone' },
      status: "idle",
      type: "WATCHING"
    })
    .then(console.log)
    .catch(console.error);
});

差不多,这对我有用,希望对你有用!

【讨论】:

猜你喜欢
  • 2021-10-28
  • 2019-04-09
  • 2020-04-14
  • 1970-01-01
  • 2023-02-25
  • 1970-01-01
  • 1970-01-01
  • 2020-08-30
  • 2022-01-11
相关资源
最近更新 更多