Type '"Rules"' is not assignable to type 'PreconditionEntryResolvable'.
Type '"Rules"' is not assignable to type 'PreconditionEntryResolvable'.
src/preconditions/Rules.ts:
types/index.d.ts:
src/commands/ping.ts:
discord.js v14.11.0
@sapphire/framework v4.4.4
8 Replies
add
export default undefined
to types/index.d.ts
. then move the entire file to src/types/index.d.ts
The former because otherwise it gets seen as a module declaration instead of a module augmentation by TypeScript
The latter because it has to be within the scope of your includes
path as defined by your tsconfig.json
i have edited my tsconfig.json to read types/index.d.ts too by adding it to do i still have to move it? if so why? i might be asking a lot sorry, just want to learn im still an intermediate
and also moving and adding
export default undefined
didn't solve the problem
the other typing is working well
it does if you set
rootDir
to src
as well because you cannot include files that are not in the rootDir.
And if you dont set rootDir
you'll get dist/src/<file>.ts
structureah alright, thanks for the information, i did all of the steps you gave but it didnt work again
shrug. No idea then. Look at some other bots or send the full code:
Discord bots that use @sapphire/framework v4
- Official Bot Examples ᴱ ᴰ ᴶˢ
- Gemboard ᴱ ᴰ
- Dragonite ᴱ ᴰ
- Radon ᴱ ᴬ
- Sapphire Application Commands Examples ᴱ
- Archangel ᴱ ᴰ
- Zeyr ᴰ ᴬ
- Birthdayy ᴰ
Discord bots that use @sapphire/framework v3
- Arima ᴱ
- Nino ᴱ ᴰ
- Operator ᴱ ᴬ ᴰ
- Spectera ᴬ
Discord bots that use @sapphire/framework v2
- Materia ᴱ
- RTByte ᴱ ᴬ
- Skyra ᴬ ᴰ
- YliasDiscordBot ᴬ
ᴱ: Uses ESM (if not specified then uses CJS)
ᴬ: Advanced bot (if not specified it is a simple bot, or not graded)
ᴰ: Uses Docker in production
ᴶˢ: Written in JavaScript. If not specified then the bot is written in TypeScript.
also regarding the db, you dont have to but you can also just add it to the container so you save yourself 1 property level
setup.ts
(or similar, called at init for example)
thanks!