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•9mo ago
Just try it! You must have created a client, now put a dot (.) & Find out There's docs too
Solution
KaydaFox
KaydaFox•9mo ago
if youre using sapphire, you can do this.container.client or import the container from the framework and then container.client
KaydaFox
KaydaFox•9mo 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•9mo 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•9mo ago
thanks
Want results from more Discord servers?
Add your server