Props
Props
are used to pass data around your project. They are typesafe and easily accessible anywhere in your project.
Setting Props
For this example, we’re using a knex
database. In order to access the knex
data in our bot, we must first add it as a prop
:
We should also update our src/app.d.ts
with the correct type, so that when we use our prop we have intellisense.
We can now access our database with the db
prop wherever client
is available.
Getting Props
To access our database in a command
, for example, we can use the props api
: