【问题标题】:Distube Bot not resuming songs if hosted with heroku如果使用 heroku 托管,Distube Bot 不会恢复歌曲
【发布时间】:2021-08-14 04:44:32
【问题描述】:

如果我的机器人由 heroku 托管,我的 resume 命令将不起作用,但如果机器人由 cmd 或 vscode 终端运行,它会完美运行。 我的恢复命令代码:

else if (command == 'resume') { `

const queque = distube.getQueue(message)

if (!queque) return message.channel.send('Nothing is playing')

    const resumeEmbed = new Discord.MessageEmbed()
    .setTitle(`:play_pause: **RESUMED SONG**`)
    .setDescription(`I have resumed that song`)
    .setColor(`#02caf7`);
   distube.resume(message);
   message.channel.send(resumeEmbed)`

【问题讨论】:

  • 在heroku上运行有没有报错?

标签: javascript heroku discord.js


【解决方案1】:

我不确定 Heroku 的高级用户,但我知道免费用户无法在事件之间缓存信息。 Heroku、Autocode 和 Glitch 都允许在事件之间进行缓存,因此如果您打算不使用 Rhythm 或类似的音乐机器人,最好自己托管。

【讨论】:

  • 这部分不正确,因为您可以使用 heroku 或 repl.it 制作云托管文件缓存信息,但如果重新启动机器人,此信息将丢失
  • 你是怎么做到的?
  • 我会尽量自己做,谢谢
  • 我删除了我之前的评论,因为我无法编辑链接,我提供的资源与 node.js 的语言不同!如果您还没有,则需要在 heroku 上使用 express 和 fs。这是我自己的代码的 sn-p,用于我上传静态文件的类似项目:codeshare.io/5N1Rzd
猜你喜欢
  • 2021-10-31
  • 2020-10-18
  • 2020-05-13
  • 2021-02-17
  • 2021-11-26
  • 2020-09-01
  • 2020-11-26
  • 2021-10-10
  • 2019-11-09
相关资源
最近更新 更多