blackcat.js-discord - v1.0.10
    Preparing search index...

    Interface EventManagerOptions

    Cấu hình cho EventManager.

    interface EventManagerOptions {
        directory: string;
        onError?: (event: { error: unknown; file: string; scope: string }) => void;
        onLoad?: (
            event: { eventName: string; file: string; scope: string },
        ) => void;
        scopes: readonly string[];
    }
    Index

    Properties

    directory: string

    Thư mục chứa các event files.

    Cấu trúc đề xuất:

    events/
    client/
    ready.ts
    guild/
    guildCreate.ts
    onError?: (event: { error: unknown; file: string; scope: string }) => void

    Callback được gọi khi xảy ra lỗi khi load event.

    onLoad?: (event: { eventName: string; file: string; scope: string }) => void

    Callback được gọi khi load event thành công.

    scopes: readonly string[]

    Danh sách scope được phép load.

    Ví dụ:

    scopes: ["client", "guild"]
    

    Nếu sử dụng "*" thì tất cả scope trong thư mục sẽ được load.