-
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sharding + custom db | important note in README
- Loading branch information
Showing
1 changed file
with
2 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e0ee063
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return client.shard.broadcastEval(() => this.giveawaysManager.getAllGiveaways());
Question: shouldn't this be
return await client.shard.broadcastEval(async () => await this.giveawaysManager.getAllGiveaways());
?I don't have the option to test it (no sharding bot), so I don't really understand it.
Is it okay to not await the promise?
I'm bad at promises so I have no clue
e0ee063
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not.
https://discord.js.org/#/docs/main/master/class/ShardClientUtil?scrollTo=broadcastEval
it returns a promise, you must resolve the promise.
e0ee063
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right and that was what confused me.
but i forgot:
await this.manager.editGiveaway
we already await it in the packge code = so no problems. I think at least
e0ee063
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, it is okay. When you call it with await, the promise is resolved either way.