【问题标题】:Discord.js My bot can't find any parent or children channel when hosted on HerokuDiscord.js 我的机器人在 Heroku 上托管时找不到任何父或子频道
【发布时间】:2021-02-05 20:47:18
【问题描述】:

好的,我正在使用 Discord.js v12.4,基本上一个命令包含一个“category.children.forEach(...)”,它在本地运行良好。但是上线的时候,category.children返回一个空集合,并且没有channel有parent,总是null。

我做了一个'guild.channels.cache.forEach(channel => console.log(channel.parent));'检查,并且始终为 null、null、null... 与孩子相同...

Heroku 为什么会在子频道和父频道方面遇到麻烦?

脚本的原始部分(在本地工作):

    let channels = [];
    let v_channels = [];
    modelCategory.children.forEach((channel) => {
        if(channel.type === "voice") v_channels[channel.position] = channel;
        else channels[channel.position] = channel;
    });
    channels = channels.concat(v_channels);
    console.log(channels);

但是当机器人在线托管时:

>> []

【问题讨论】:

    标签: javascript heroku discord.js


    【解决方案1】:

    快速更新:我也无法再在本地获取父级和频道。

    【讨论】:

      猜你喜欢
      • 2020-06-27
      • 2019-02-14
      • 2021-08-10
      • 2020-06-30
      • 2017-07-26
      • 2021-11-10
      • 1970-01-01
      • 2021-05-28
      • 1970-01-01
      相关资源
      最近更新 更多