Regarding containers
Hello! With regards to the example repos with setup.ts, is every property in the container already available like the Client at startup?
Solution:Jump to solution
Which one exactly are you talking about? There are 3 examples that have a setup.ts and each has some unique content, and none use container. At any rate, the idea of
setup.ts
is that it is called before you can new SapphireClient
, which happens automatically through line 1 at https://github.com/sapphiredev/examples/blob/main/examples/with-typescript-starter/src/index.ts, by calling just import './lib/setup.ts'
instead of something like import { x } from './lib/setup.ts'
that file i...3 Replies
Solution
Which one exactly are you talking about? There are 3 examples that have a setup.ts and each has some unique content, and none use container. At any rate, the idea of
setup.ts
is that it is called before you can new SapphireClient
, which happens automatically through line 1 at https://github.com/sapphiredev/examples/blob/main/examples/with-typescript-starter/src/index.ts, by calling just import './lib/setup.ts'
instead of something like import { x } from './lib/setup.ts'
that file is executed at import.Ah I see so it was called before the Client, it's all good now, thank you for the clarification!!
And since you are using containers, you can just pass the token as env variable in container build config 🤔