【问题标题】:How do I make my discord bot only read content in a certain channel如何让我的不和谐机器人只读取某个频道中的内容
【发布时间】:2021-05-16 19:13:03
【问题描述】:

我需要帮助让我的不和谐机器人只阅读特定频道中的消息

假设你把 !+!Verify 放在验证通道中,我希望它验证你

但是假设你把它放在通用频道我希望它不验证你

【问题讨论】:

    标签: javascript discord discord.js


    【解决方案1】:

    您可以使用channel.id 获取频道 ID,如果您从消息 (message.channel.id) 中获取频道,您可以在 if 语句中使用它来过滤频道

    // client.on etc...
    
    if (message.channel.id === 'CHANNEL-ID') {
        // When it is in the right channel
    }
    

    【讨论】:

      猜你喜欢
      • 2020-12-28
      • 2021-06-15
      • 2020-11-18
      • 1970-01-01
      • 2020-10-15
      • 2021-03-31
      • 2020-12-30
      • 2019-06-24
      • 2020-10-03
      相关资源
      最近更新 更多