我如何“链接"?像我的 Discord Bot 消息中提及的频道? [英] How do I "Link" a channel like a mention in my Discord Bot message?

查看:16
本文介绍了我如何“链接"?像我的 Discord Bot 消息中提及的频道?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我们的 Discord Bot 提及特定频道,并使其可点击.我了解提及您使用用户 ID 的用户.我确实有频道 ID,只是不确定如何实现它.

I'd like our Discord Bot to mention a specific channel, and let it be clickable. I understand mentioning a user you use the user ID. I do have the channel Id, just unsure how to implement it.

推荐答案

您只需要执行以下操作:

You just have to do the following:

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

或者如果您从机器人获取频道 ID

or if you get the channel id from the bot

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}>`)

然后这个频道就可以点击了,就像这个截图一样:

Then the channel is clickable like in this screenshot:

这篇关于我如何“链接"?像我的 Discord Bot 消息中提及的频道?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆