【问题标题】:Mentioning roles in slash command reply discors.js BOT在斜杠命令回复 discord.js BOT 中提及角色
【发布时间】:2021-11-04 03:01:44
【问题描述】:

我正在使用 discord js v13.2.0 制作一个 Discord 机器人,我想回复一个提及角色的交互,但是当交互被“发送”时,它不会 ping 角色。

我只是代码的初学者,所以也许我做错了什么,我尝试在互联网上查找但一无所获。

    async execute(interaction, client) {
      interaction.reply({
        "content": "This is the role mention  : <@&roleid>"
      })

    },

What I have

【问题讨论】:

    标签: discord discord.js


    【解决方案1】:

    要允许在互动中提及,您可以使用allowedMentions:

    interaction.reply({
        allowedMentions: {roles: ['YOUR_ROLE_ID']},
        content: "This is the role mention: <@&roleid>"
    })
    

    【讨论】:

      猜你喜欢
      • 2022-01-07
      • 1970-01-01
      • 2022-11-26
      • 2020-09-11
      • 2021-11-09
      • 2022-01-03
      • 1970-01-01
      • 2017-02-11
      相关资源
      最近更新 更多