HarmonyLink Documentation

    DJSLibrary

    harmonylinkDocs


    harmonylink / DJSLibrary

    Class: DJSLibrary

    Extends

    • default

    Constructors

    new DJSLibrary()

    new DJSLibrary(client): DJSLibrary

    Parameters

    client: any

    Returns

    DJSLibrary

    Inherited from

    AbstractLibraryClass.constructor

    Defined in

    src/librarys/AbstractLibraryClass.ts:17

    Properties

    client

    protected readonly client: any

    Inherited from

    AbstractLibraryClass.client

    Defined in

    src/librarys/AbstractLibraryClass.ts:14


    manager

    protected manager: null | HarmonyLink = null

    Inherited from

    AbstractLibraryClass.manager

    Defined in

    src/librarys/AbstractLibraryClass.ts:15

    Accessors

    userID

    get userID(): string

    Get the user ID of the bot

    Abstract

    getter method for the user ID of the bot

    Returns

    string

    Overrides

    AbstractLibraryClass.userID

    Defined in

    src/librarys/DJS.ts:7

    Methods

    initialize()

    initialize(manager): this

    Initialize the library class

    Parameters

    manager: HarmonyLink

    The HarmonyLink instance

    Returns

    this

    the instance of the class

    Inherited from

    AbstractLibraryClass.initialize

    Defined in

    src/librarys/AbstractLibraryClass.ts:27


    listen()

    listen(nodes): void

    Listen for events from the discord gateway that are arriving on the library

    Parameters

    nodes: NodeGroup[]

    Returns

    void

    Abstract

    method to listen for events from the discord gateway that are arriving on the library

    Overrides

    AbstractLibraryClass.listen

    Defined in

    src/librarys/DJS.ts:19


    raw()

    protected raw(incomingData): Promise<DJSLibrary>

    Handle raw packets from the gateway

    Parameters

    incomingData: Packet

    The packet to handle

    Returns

    Promise<DJSLibrary>

    Inherited from

    AbstractLibraryClass.raw

    Defined in

    src/librarys/AbstractLibraryClass.ts:36


    ready()

    protected ready(nodes): Promise<void>

    Parameters

    nodes: NodeGroup[]

    Returns

    Promise<void>

    Inherited from

    AbstractLibraryClass.ready

    Defined in

    src/librarys/AbstractLibraryClass.ts:72


    sendPacket()

    sendPacket(shardId, payload, important): void

    Send raw packets to the gateway to communicate with the Discord API

    Parameters

    shardId: number

    The shard ID to send the packet with

    payload: AnyOtherPacket

    The payload to send

    important: boolean = false

    Whether the packet is important or not (default: false)

    Returns

    void

    Abstract

    method to send packets to the gateway

    Overrides

    AbstractLibraryClass.sendPacket

    Defined in

    src/librarys/DJS.ts:15


    shardID()

    shardID(guildId): number

    Parameters

    guildId: string

    Returns

    number

    Overrides

    AbstractLibraryClass.shardID

    Defined in

    src/librarys/DJS.ts:11