从提及中查找用户(Discord.js,斜线命令)

时间:2021-04-26 14:40:06

标签: javascript node.js discord.js

我基本上有一个价值,我希望我的机器人在我的公会中找到那个用户。我正在尝试使用斜杠命令执行此操作!

//This gets the guild that the slash command was used in
const guild = bot.guilds.cache.get(interaction.guild_id)

//This is for example, the content from the slash command would be like this
let value = `<@!123456789012345678>`

//I tried this but it doesn't work
//This is what I need to know
let userR = guild.members.cache.find(member => member === value)

如果有人知道如何做到这一点,请告诉我。谢谢! (另外我刚接触过 stackoverflow,所以我还挺新的)

0 个答案:

没有答案