Skip to content

command的同步callback中如何处理异步方法? #1416

Answered by shigma
little-creeper asked this question in Q&A
Discussion options

You must be logged in to vote

command 的 action 是异步的,加个 async 即可。

.action(async () => {
  await getServerStatus()
})

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by little-creeper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants