【问题标题】:Bot that allows me to send a message to a specific Discord channel and will also be sent to a different channel?允许我向特定的 Discord 频道发送消息并且也将被发送到不同频道的机器人?
【发布时间】:2020-12-09 06:47:05
【问题描述】:

当我在不和谐频道中发送消息时,如何创建一个机器人,它也会被发送到不同的频道?节省时间而不是复制和粘贴

【问题讨论】:

    标签: discord discord.js


    【解决方案1】:

    你可以使用:

    message.channel.send(message)
    message.client.channels.cache.get('<Put the channel ID here>').send(message)
    

    【讨论】:

      【解决方案2】:

      所以您想要一个自动将您发送的消息发送到另一个频道的机器人?

      bot.on("message", message => {
        if (message.author.id === "YOUR ID HERE") {
              message.client.channels.cache.get('<Put the channel ID here>').send(message.content)
        }
      });
      

      【讨论】:

        猜你喜欢
        • 2020-10-01
        • 2023-01-17
        • 2021-03-24
        • 2021-10-28
        • 2021-01-10
        • 1970-01-01
        • 2020-04-07
        • 2021-06-10
        • 1970-01-01
        相关资源
        最近更新 更多