简体   繁体   中英

Select a random Guild member using Discord.js

I'm trying to make a command that based off of one of the april fools videos will mention a random member of teh server. unfortuneately ive had no luck with everything ive googled.

I would like to mention I'm still very new to javascript and discord.js

the best ive found so far is:

interaction.guild.members.random();

and that didnt work (it told me its not function)

It should be interaction.guild.members.cache.random() – Zsolt Meszaros

turns out I was missing the cache part of the command.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM