Developer
Interfaces
Extended Client

Extended Client

The Extended Client refers to an enhanced version of the standard Discord client provided by the discord.js library. By extending the base client, we can add custom properties and methods that are specific to our bot's needs. This could include additional configurations, utility functions, or other custom features that the standard client does not provide.

Project Structure

First, create a folder named interfaces inside the src directory. Inside this interfaces folder, create a file named ExtendedClient.ts. This files will hold the constants for your project.

  • Create ExtendedClient.ts

    You can extend your client as you want!
    src/interfaces/ExtendedClient.ts
    import { Client, Collection } from 'discord.js'
    import { Command } from './Command'
     
    export interface ExtendedClient extends Client {
      events: Collection<string, (...args: any[]) => void>
      messageCommands: Collection<string, Command>
      slashCommands: Collection<string, Command>
    }

    Alright, now let's move ahead!