📌  相关文章
📜  Discord.js 让机器人加入音乐频道 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:17.229000             🧑  作者: Mango

代码示例1
client.on("ready", () => {
  const channel = client.channels.get("mychannelid");
  if (!channel) return console.error("The channel does not exist!");
  channel.join().then(connection => {
    // Yay, it worked!
    console.log("Successfully connected.");
  }).catch(e => {
    // Oh no, it errored! Let's log it to console :)
    console.error(e);
  });
});