Koncealed Posted March 31, 2021 Report 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
Dr. McKay Posted March 31, 2021 Report 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
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.