【发布时间】:2020-10-30 15:29:15
【问题描述】:
所以我在我的 discord 机器人中添加了一项功能来收集用户最近的游戏剪辑,目前我能够收集控制台日志中的所有信息,但很难理解如何在消息中发送它。我对这些东西很陌生。
这是我现在的代码的 sn-p:
const userXuid = await XboxLiveAPI.getPlayerXUID(gamertag, authInfo).catch(err => message.reply('That gamertag could not be found. Make sure spaces are replaced with \'_\''));
const scores = await XboxLiveAPI.getPlayerScreenshotsFromMediaHub(userXuid, authInfo, num);
console.log(scores);
这就是返回到控制台的内容:
{
continuationToken: 'YWJjZGVfdnd4eXoxMDA1',
values: [
{
captureDate: '2016-09-13T19:11:11Z',
contentId: 'e61118b6-c940-4hc9-a32a-49dd53ab4192',
contentLocators: [Array],
CreationType: 'Edited',
localId: '501bf44b-c1b2-4519-b78e-a1f88097f8d1',
ownerXuid: 25332749247888726,
resolutionHeight: 720,
resolutionWidth: 1280,
sandboxId: 'RETAIL',
sharedTo: [],
titleId: 1129121809,
titleName: 'OF: Dragon Rising',
dateUploaded: '2016-09-13T19:12:34.6226406Z',
uploadLanguage: 'en-GB',
uploadRegion: 'GB',
uploadTitleId: 201477059,
uploadDeviceType: 'XboxOne',
commentCount: 0,
likeCount: 0,
shareCount: 0,
viewCount: 2,
contentState: 'Published',
enforcementState: 'None',
safetyThreshold: 'None',
sessions: [],
tournaments: []
}
]
}
结论
那么,例如,我将如何获取 captureDate 以发送:
message.channel.send(???)
任何帮助将不胜感激,干杯!
【问题讨论】:
标签: javascript node.js arrays promise discord.js