#property commands does not exist on type Client

1 messages · Page 1 of 1 (latest)

blazing hill
#

Do you know how to work with classes?

#

@distant vapor

rancid siren
#

sup guys

distant vapor
#

hello

distant vapor
rancid siren
distant vapor
#

good wbu

rancid siren
#

Pretty fine, still looking for a way to send a message to a specific channel but yeah I work hard

#

And u, what's ur doing here

distant vapor
#

i switched to typescript

#

so i basically dug my own grave

blazing hill
blazing hill
# distant vapor nope

It's worth a read, I'd recommend reading that before working with anything typescript

distant vapor
#

i mean is it like python by any chance

#

cause i used classes in python a lot

rancid siren
rancid siren
blazing hill
distant vapor
#

alr

#

so what exaclty should I do to avoid this error

#

make a class

#

that s different

#

from like the imports

#

kinda hard to explain since english is my second language

rancid siren
distant vapor
rancid siren
#

?

distant vapor
#

lol

blazing hill
#

And call its constructor

#

Make sure to add the "commands" property in it

distant vapor
#
declare module "discord.js" {
  export interface Client {
    commands: Collection<unknown, any>
  }
}
#

this

#

??

blazing hill
#

No no

#

Import Client

#

Make a new class

#

CommandClient maybe

#

And make it inherit Client

rancid siren
#

look too odl

blazing hill
rancid siren
#

const client = new CommandClient

#

i'm a genious

#

there u go never ming who .

blazing hill
#

Stop, please.