获取主频道,或者邀请的频道link

Get the main channel, or the channel of the invite link

如何从服务器获取主频道?几乎所有主要的机器人都这样做。例如,节奏。机器人会在主频道中发送一条消息,告诉您如何使用 Rythm。这也是我打算做的,让人们知道如何使用我的机器人。如果你能帮我解决这个问题,我将不胜感激。谢谢!

公会有一个 defaultChannel 您可以访问的值。

guild.defaultChannel.send(`Hello`);

文档: https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=defaultChannel 虽然这是 已弃用,但您仍然可以使用它,除非删除 #general 频道。

否则:
对于频道,邀请是指: https://discord.js.org/#/docs/main/stable/class/Invite
invite.channel 是邀请所指的频道