Access extended sapphire client
Following usecase:
I extended the sapphire client in order to create custom collections etc.
Is there any way I can access the extended client through the container?
Solution:Jump to solution
container.client
, and you need to add module augmentation to add the properties to the Client
class from discord.js
```ts
declare module 'discord.js' {
interface Client {
myCustomProperty: any...9 Replies
Solution
container.client
, and you need to add module augmentation to add the properties to the Client
class from discord.js
anyway why would you add them to the client specifically when you can also just add them to the container directly. Save yourself the trouble of doing
container.client.custom
and just do container.custom
By the way, you're more encouraged to extend
container
rather than SapphireClient
👀It's also far easier because you can just:
Thanks for the help <:PES_Ok:493353112501747712>
i tried this and it's giving me an error
for typescript to recognise it for me, i have to do it like this
seems to be done that way in iriss too
so @Upsided i think you should maybe try that instead?
thanks mayne it worked