I am new to JavaScript. I am making a discord bot that gets game statistics from the steam API. I use the npm package steam-api and discord.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:
"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:
However, a Steam usrer can make their game list private if they so wish. 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.
Related
I've been working on an instant game for Facebook. All I want is to send a notification that invites the user to play again. I've been checking out documentation for it but it is very unclear on that matter.
I am already using the SDK for instant games and got it running, but I have no idea on how to use the graph API to only send a notification. I don't know in which file I have to put the code for it, nor where to reference it in the index.
you need to add a messenger bot to be able to message users.
check this is the bot docs
[1]: https://developers.facebook.com/docs/games/instant-games/getting-started/bot-setup/
I have been making web applications for around 4 years now, and I have always had troubles setting up the Facebook web SDK.
But for my new application I really wanted to make the Facebook integration.
The problem I am facing now, is that I am using the JS SDK witch was fairly easy to set up, but now I want to build my backend to support it all. The flow I came up with was like this:
The user logs in
The user giving me their FB-id
A call from the back end create the new profile or logs if its a older user
The api gives back a api key for the other requestes.
The problem I see with this flow is, that if another person haves another users facebook id, they can obtain a api key for that user, just by sending the request with that id to the server.
How can I make this secure. I don't really thing that the docs on facebook are great, and the other tutorials on the web dos not cover this topic.
Thanks for the help guys!
We've developed a bot for our website which is used as a sort of messenger, the user selects if they want to speak to our support or chat team and it routes them to the correct team. The chat escalation and chat service is provided by Live Assist.
After developing the bot locally, all seemed to work fine, however once we launched it live, we discovered that the bot is only allowed one conversation at a time through Live Assist. What happens is anyone who opens the chat, no matter which device, is apart of the same single instance conversation. We contacted Live Assist and they said we require multiple bots to handle multiple chat instances. They did link us to a few of their online resources but they did not provide any advice for this particular problem (which we assume is a common one?)
I've been scratching my head at how something like this could be implemented, we are able to host multiple bots on Azure but I am stumped at finding a way to cleanly poll a bot to see if a conversation is in progress without interrupting that particular conversation. The only resource found which may assist is here however it is in node.js, whereas our solution is JavaScript on the front end and the bot code is C# .Net.
Any guidance would be greatly appreciated. Many thanks.
Edit: To clarify, we are wondering if what we want is possible, if it is possible to have multiple azure bot framework instances and reach them all through javascript on a webpage, poll if a chat is active, and then use a free bot for the user.
In bot framework, there is no built-in feature to accomplish this since natively bot framework supports multiple concurrent conversations across all channels. As a workaround for the limitation of Live Assist let me share one idea I have.
You could in some sort of data store have a time that resets everytime a message is sent/received and once that timer expires that would qualify the bot as "not in a conversation". In this scenario when your webpage loads, it would ping your datastore to see which bot was available and if one is available, return the direct line secret token for the available bot. This would cause your front end to load up the chat for the correct bot. I do not have an implementation to share because I have never seen a scenario like this, but I hope this helps.
I'm trying to develop a discord bot. I have it so when a command is called "opgg examplename" it will search the example name on the website op.gg. I want it to be able to take a screenshot of that webpage given, and attach it in discord. Anyone have any ideas? Thanks
I do not know any solution to your problem, But I know what you want to do and I have an alternative. If you want to create a bot to get information about lol player stats I recommend any scrape/crawler to get the info from site, them use this info to make any visualisation with your desing and send in discord.
Remember to that riot has public api, you can make the request direct to riot, after process the data, generate any visualization and send in discord.
This might sound super crazy but I really want to know if this can be done.
Assume a multi-user site that gives users some tools to build web apps from the site itself (using only HTML/CSS/JS) and share them. Now, if each of the apps were to be assigned a datastore, say just a table for convenience, is it possible to make secure query/insert requests from the app to the backend to write to the assigned table.
Take an example - the app is a small game. The developer wants to record the scores of the users who play the game and wants to use his assigned datastore (see above) for it. Is it possible for the site to ensure that no other app/user can access this datastore? If so, how can it be done?
Edit: Please do note that there are three parties involved - the developer of the app who is a registered user, the app itself which has been granted the datastore and an app user (registered/unregistered) who is viewing the app.
I think this is the same as using any type of backend datastore for any web app. You could assign the user a unique ID (which they have to validate by logging in) and then manage access to the datastore through AJAX post backs.