tvman99
-
Posts
8 -
Joined
-
Last visited
Posts posted by tvman99
-
-
I have a function which checks the input is in json data from url. How can i implement async await into it? I've got no success. All my attempts were returning pending promises.
function checkUser(id){ var url = 'http://mywebsite.com'; var jsonObject; request(url, function (error, response, body) { if (!error && response.statusCode == 200) { jsonObject = JSON.parse(body); if (jsonObject.hasOwnProperty(id)) return jsonObject[id]; else return 0; } }); }
-
It works with initial value. So I think i should clear cache and refresh after every changes somehow. How can i achieve it without restarting whole nodejs app?
Edit: I found a way and it is only to check steamid is equal to variable within friendMessage id event.
-
I have variable that contains steamid64. There is a reason using variable, Because it changes. This id event is not working, However it does with const. Does it work only with const? If yes, How can i make it work?
client.on('friendMessage#' + variable, function(steamID, message) { console.log("works"); client.chatMessage(steamID, "works " + message); });
-
McKay, Is it possible that asset id is different in the url? I get a number from the item's assetid and id which are literally the same. But when i see it in the inventory appid context id are same but asset id is completely different even in length.
edit: my bad. asset id was changed after trade but i get assetid by using offer.getReceivedItems only if the items sent to a bot account. It shows an error saying the offer is not accepted if the items taken from a bot account. I used getReceivedItems in callback of accept(offer).
edit 2: i used getExchangeDetails too. It gives no trade id unable to get trade details error. As long as if any items are not taken from a bot account, which means bot gives nothing, then it works as expected. I wonder why it works when no item is taken from a bot account. Unfortunately, this happens to be the same for getReceivedItems. I tested every possible scenario.
-
I am looking to make some sort of cpanel for bot. Is it possible to start/stop bot from web? I mean from nodejs or php. Also how can i pass username and password which is stored in db from web. Should i get username and password from db directly? what do you think. I would'nt prefer it logs in then logs out since node is still running the file on the server.
-
So there is no way to do it?
-
I've been trying to make async/await work. If someone sends specific message they get specific pre-written reply. I've done that using friendMessage ID event. Down the road, I need to catch the user's reply to include it in the reply. Well i assume if i give you an example of it. Ofc the user should start it as long as bot does something depends on the chat message/ i call it chat command/.
User: !addadmin
Bot: Who's it? Send the steamid64 to me.
User: xxxxxxxxxxxxxxxxx /*sends steamid64*/
Bot: xxxxxxxxxxxxxxxxx is not in my friends list. Tell him to add me. OR Bot: xxxxxxxxxxxxxxxxx is in my friends list. Made him/her the master of me.
It was an example. If you are able to, code the catching of user reply and using it in some checks then replies.
Poll Failure error socket hang up
in node-steam-tradeoffer-manager
Posted · Edited by tvman99
Sometimes pollFailure event is emitted and gives the error below.
My script is running on AWS. So there shouldn't be any issues with the network.