【问题标题】:Change Channel name with a command and also send embed with it使用命令更改频道名称并使用它发送嵌入
【发布时间】:2018-05-03 03:30:33
【问题描述】:

我正在制作一个不和谐的机器人,它将更改频道的特定名称

代码

if(command === `${prefix}openslot`) {

    let embed = new Discord.RichEmbed()
        .setColor("#1bc643")
        .setTitle("Sucessfully opened slot for PREMIUM RANK!")
        .addField("Created At", message.author.createdAt)

        .setDescription("SYSTEM");

    message.channel.sendMessage(embed);
    channel.setName('Reserved_Slot')

.then(newChannel => console.log(Channel's new name is ${newChannel.name})) .catch(console.error);

    return;
}

我也是 discord.js 的新手(一个月前开始)

【问题讨论】:

    标签: embed discord.js


    【解决方案1】:

    没关系,我自己找到的。

    message.guild.channels.find("name", "general").setName("Testing");
    

    感谢您纠正我的语法。

    【讨论】:

      猜你喜欢
      • 2021-03-24
      • 2020-08-12
      • 1970-01-01
      • 1970-01-01
      • 2019-01-13
      • 2019-12-28
      • 1970-01-01
      • 2021-09-24
      • 1970-01-01
      相关资源
      最近更新 更多