Property 'cmds' does not exist on type 'Client<boolean>'

It's my first time using TypeScript with discord.js & express, I used some of my JS knowledge and it is causing an error now. (if it isnt fixable then what would be the best way to approach slash command handlers on TypeScript)

C:\Users\------\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
src/client.ts:15:8 - error TS2339: Property 'cmds' does not exist on type 'Client<boolean>'.

15 client.cmds = new Collection();
          ~~~~

    at createTSError (C:\Users\------\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:859:12)
    at reportTSError (C:\Users\------\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:863:19)
    at getOutput (C:\Users\------\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1077:36)
    at Object.compile (C:\Users\------\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1433:41)
    at Module.m._compile (C:\Users\------\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1617:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Object.require.extensions.<computed> [as .ts] (C:\Users\------\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:827:12)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:170:29) {
  diagnosticCodes: [ 2339 ]
}


npm v.9.6.7
node v.18.3.0
discord.js v14.11.0
image.png
image.png
Was this page helpful?