How to reference client in main file?

I am trying to get <Client>.users from the index.ts but I am unsure as to how I would get around to doing that..
Solution:
if youre using sapphire, you can do this.container.client or import the container from the framework and then container.client
Jump to solution
5 Replies
MRDGH2821
MRDGH2821•11mo ago
Just try it! You must have created a client, now put a dot (.) & Find out There's docs too
Solution
KaydaFox
KaydaFox•11mo ago
if youre using sapphire, you can do this.container.client or import the container from the framework and then container.client
KaydaFox
KaydaFox•11mo ago
Sapphire Framework
Using and extending container | Sapphire
The container is a way in which Sapphire achieves Dependency Injection. This is a very useful feature, since it
Lioness100
Lioness100•11mo ago
Make sure the client has logged in first, or you won't be able to access any users. Consider doing whatever you're doing in the ready event?
willow 🌷
willow 🌷OP•11mo ago
thanks
Want results from more Discord servers?
Add your server