简体   繁体   English

如何检查Steam用户是否有游戏

[英]How to check to see if steam user has a game

I am new to JavaScript. 我是JavaScript新手。 I am making a discord bot that gets game statistics from the steam API. 我正在制作一个从Steam API获取游戏统计信息的不和谐机器人。 I use the npm package steam-api and discord.js-commando . 我使用npm包steam-apidiscord.js-commando I can't figure out a way how to check to see if a steam user has a game. 我想不出一种方法来检查蒸汽用户是否玩过游戏。

Whenever you input a steamID64 that has their games private or doesn't have the game it will print this in the terminal: 每当您输入将自己的游戏steamID64私有或不拥有游戏的steamID64 ,它将在终端中显示以下内容:

"D:\Discord Bots\statbot\node_modules\q\q.js:155
            throw e;"

I have been trying to solve this for a week and a half. 我已经尝试解决了一个半星期的时间。 I could not find anything to solve this. 我找不到任何解决方法。

Thank you for your time. 感谢您的时间。

The Steam API has an API call that allows you to get owned games for a user: Steam API有一个API调用 ,可让您为用户获得拥有的游戏:

However, a Steam usrer can make their game list private if they so wish. 但是,如果愿意,Steam usrer可以将其游戏列表设为私有。 If it is necessary to use your software you could get an application ID of your own and then ask the user to allow your application to make the call using an OpenID library. 如果有必要使用软件,则可以获取自己的应用程序ID ,然后要求用户允许您的应用程序使用OpenID库进行调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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