Koncealed Posted March 31, 2021 Report Share Posted March 31, 2021 Hello, I worked on projects where I could use async await to try to make my functions a bit cleaner instead of falling into callback hell. So I wrote this below. async _fetchInventory() { this.inventory = await this.tradeOfferBot.getInventoryContents(this.GAME_CODE, 2, true); console.log('Below is from the fetch inventory function.'); console.log(this.inventory); } I want to add the items into a variable inside of my class. Is this possible? Thanks! Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted March 31, 2021 Report Share Posted March 31, 2021 steam-tradeoffer-manager does not presently support promises (async/await), although that's planned for the near future. In the meantime, you'll need to wrap the call in a Promise. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.