Closed ghost closed 6 years ago
Before copy & pasting anything you see on the internet, be sure you understand what it does first. Read this article to understand more about async/await: https://anidiots.guide/other-guides/async-await.
Still confused..
is rbx.getStatus not a async function?
Yes and that's why you must use it inside an async function while awaiting it.
On Sat, Jun 9, 2018 at 14:57 OutlookG notifications@github.com wrote:
is rbx.getStatus not a async function?
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/sentanos/roblox-js/issues/102#issuecomment-395991143, or mute the thread https://github.com/notifications/unsubscribe-auth/AMKxJK_ZOO6ruQvKj-AQouY-5vCLOOrNks5t7BqOgaJpZM4UfIgK .
The issue is not rbx.getStatus, it has nothing to do with whether rbx.getStatus is an async function. The function using async/await has to be async.
On Jun 9, 2018, at 12:15, suufi notifications@github.com wrote:
Yes and that's why you must use it inside an async function while awaiting it.
On Sat, Jun 9, 2018 at 14:57 OutlookG notifications@github.com wrote:
is rbx.getStatus not a async function?
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/sentanos/roblox-js/issues/102#issuecomment-395991143, or mute the thread https://github.com/notifications/unsubscribe-auth/AMKxJK_ZOO6ruQvKj-AQouY-5vCLOOrNks5t7BqOgaJpZM4UfIgK .
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
so I have to put it in a async function.. ohhhh ok.
So I took the code from some other thread that was answered..
And it comes up with this error:
await is only valid in async function
const status = await rbx.getStatus(await rbx.getIdFromUsername(username));