owengombas / discord.ts

🤖 Create your discord bot by using TypeScript and decorators!

Home Page:https://owencalvin.github.io/discord.ts/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can't inject Client on @On("ready")

singatias opened this issue · comments

the client is undefined when injected in the ready event. I'm trying to create a channel if it doesn't exist when my bot startup.

can u post a snippet of your code

@Once("ready")
onReady([]: ArgsOf<"ready">, client: Client): void {
  //client stuff
}

is how you can do that with the client injection
https://github.com/OwenCalvin/discord.ts#client-payload-injection

Sorry for the late response. I was missing the []: ArgsOf<"ready"> first part.

Thank You