javascript - 我如何从收藏中获得第二个成员
问题描述
我有这个收藏:
Collection {
'200641654165165' => ClientUser {
id: '200641654165165',
username: 'test',
discriminator: '4905',
avatar: 'r32rfk324r5aspp;d',
bot: true,
lastMessageID: '450334234326660373',
lastMessage:
Message {
channel: [TextChannel],
id: '45035325246660373',
type: 'DEFAULT',
content: '',
author: [Circular],
member: [GuildMember],
pinned: false,
tts: false,
nonce: null,
system: false,
embeds: [Array],
attachments: Collection {},
createdTimestamp: 152723434238,
editedTimestamp: null,
reactions: Collection {},
mentions: [MessageMentions],
webhookID: null,
hit: null,
_edits: [] },
verified: true,
email: null,
localPresence: { status: 'online', game: [Object], afk: false, since: 0 },
_typing: Map {},
friends: Collection {},
blocked: Collection {},
notes: Collection {},
premium: null,
mfaEnabled: true,
mobile: null,
settings: ClientUserSettings { user: [Circular] },
guildSettings: Collection {} },
'204651434234236752' => User {
id: '204651434234236752',
username: 'me',
discriminator: '4212',
avatar: '9574776gfv3f3c01facc41a01d26',
bot: false,
lastMessageID: '45036434494844427',
lastMessage:
Message {
channel: [TextChannel],
id: '45036953244844427',
type: 'DEFAULT',
content: '.c',
author: [Circular],
member: [GuildMember],
pinned: false,
tts: false,
nonce: '450369532530174208',
system: false,
embeds: [],
attachments: Collection {},
createdTimestamp: 1523246950554,
editedTimestamp: null,
reactions: Collection {},
mentions: [MessageMentions],
webhookID: null,
hit: null,
_edits: [] } } }
我用这个得到了
const reactions = await msg.awaitReactions(reaction => reaction.emoji.name === join, {time: 3000})
const user = reactions.get(join).users
而且我不知道如何从这个集合中获得第二个成员。
解决方案
找到解决方案。
用“const user =reactions.get(join).users.first(2)[1]”替换“const user = reaction.get(join).users”
推荐阅读
- vue.js - 在Vuetify中内联编辑数据表时如何防止无效值
- sql - 为什么搜索空字符串这么快?
- regex - 用于匹配带或不带破折号的数字模式的正则表达式
- angular - 如何修复无法读取角度材料中未定义的属性“时间”?
- docker - 来自 docker 映像的 Elasticsearch 服务未连接到 webapp 或 kibana
- dictionary - 关于为什么我的字典不起作用的初学者问题
- javascript - 我正在尝试使用包含我添加到用户数组的新用户对象的内联数组来调用 displayUsers
- wordpress - 如何让这个插件简码正确显示
- javascript - 从表格每一行的输入中获取数据
- node.js - 升级节点后,出现“分段错误(核心转储)”错误。我该如何解决?