【问题标题】:How do I send a message without using the deprecated way "sendMessage" in discord.js?如何在不使用 discord.js 中已弃用的方式“sendMessage”的情况下发送消息?
【发布时间】:2018-05-09 01:06:03
【问题描述】:

如何在 discord.js 中向频道发送消息?我知道如何,但 msg.channel.sendMessage 正在被弃用。如何在不弃用且不使用 msg.reply 的情况下发送消息?

【问题讨论】:

    标签: discord.js


    【解决方案1】:

    你只需要做message.channel.send(“text to send”) 如果您想做一个特定的频道,您可以执行以下操作

     Let messageChannel = message.guild.channels.find(“name”, “general”)
     messageChannel.send(“your message”)
    

    【讨论】:

      【解决方案2】:

      【讨论】:

        猜你喜欢
        • 2016-10-27
        • 2021-07-30
        • 2014-01-28
        • 2022-08-06
        • 2021-07-01
        • 2020-08-04
        • 2018-04-11
        • 2018-09-24
        相关资源
        最近更新 更多