gpt4 book ai didi

discord - 我如何 "Link"在我的 Discord Bot 消息中提到一个 channel ?

转载 作者:行者123 更新时间:2023-12-03 18:40:51 28 4
gpt4 key购买 nike

我希望我们的 Discord Bot 提及一个特定的 channel ,并让它可以点击。我了解提到您使用用户 ID 的用户。我确实有 channel ID,只是不确定如何实现它。

最佳答案

您只需执行以下操作:

message.channel.send('Please take a look at this Discord Server channel <#CHANNELID>')

或者如果您从机器人获得 channel ID
const channel = message.guild.channels.find(channel => channel.name === 'Name of the channel');
message.channel.send(`Please take a look at this Discord Server channel <#${channel.id}>`)

然后 channel 是可点击的,如下图所示:

关于discord - 我如何 "Link"在我的 Discord Bot 消息中提到一个 channel ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55283358/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com