DJS v13-在没有任何用户交互的情况下重命名频道



我能问一下,如何在没有任何用户输入的情况下正确地找到频道(通过id或名称(吗?我正在做自动频道,每30秒更新一次。那么,有没有机会,我可以重命名频道,而不需要任何用户交互在我正在寻找的频道?(到目前为止,我还没有看到这个话题的任何答案(如果你能帮我,我会感谢你的。

您可以使用<TextChannel>.edit()<TextChannel>.setName()更改通道名称。有关使用edit()的更多信息,请点击此处。有关使用setName()的更多信息,请点击此处。例如,这些将起作用:

使用<TextChannel>.edit()

// Edit a channel
channel.edit({ name: 'new-channel' })
.then(console.log)
.catch(console.error);

使用<TextChannel>.setName()

// Set a new channel name
channel.setName('not_general')
.then(newChannel => console.log(`Channel's new name is ${newChannel.name}`))
.catch(console.error);

希望这能有所帮助

相关内容

最新更新