Hierarchy

  • DMManager

Constructors

Properties

Accessors

Methods

Constructors

  • Parameters

    • token: string

      Your Bot's Discord Token

    • mongodb: XOR<MongoClient, {
          options?: Partial<MongoOptions>;
          url: string;
      }>
    • Optional restOptions: Partial<RESTOptions>

    Returns DMManager

Properties

#cache: Map<string, string> = ...
#client: MongoClient
#errorHandler: ((error) => null) = noop

Type declaration

    • (error): null
    • Parameters

      • error: unknown

      Returns null

#rest: REST
token: string

Your Bot's Discord Token

Accessors

  • get db(): Collection<Document>
  • Returns Collection<Document>

  • get dms(): {
        cache: ((userId, channelId) => Promise<{
            message: string;
            status: false;
        } | {
            message: string;
            status: true;
        }>);
        createDMChannel: ((userId) => Promise<null | string>);
        get: ((userId, force?) => Promise<{
            message: string;
            status: false;
        } | {
            channelId: string;
            status: true;
        }>);
        recache: (() => Promise<{
            message: string;
            status: false;
        } | {
            message: string;
            status: true;
        }>);
        remove: ((userId) => Promise<{
            message: string;
            status: false;
        } | {
            message: string;
            status: true;
        }>);
        removeAllChannel: ((channelIds) => Promise<{
            message: string;
            status: false;
        } | {
            message: string;
            status: true;
        }>);
    }
  • Returns {
        cache: ((userId, channelId) => Promise<{
            message: string;
            status: false;
        } | {
            message: string;
            status: true;
        }>);
        createDMChannel: ((userId) => Promise<null | string>);
        get: ((userId, force?) => Promise<{
            message: string;
            status: false;
        } | {
            channelId: string;
            status: true;
        }>);
        recache: (() => Promise<{
            message: string;
            status: false;
        } | {
            message: string;
            status: true;
        }>);
        remove: ((userId) => Promise<{
            message: string;
            status: false;
        } | {
            message: string;
            status: true;
        }>);
        removeAllChannel: ((channelIds) => Promise<{
            message: string;
            status: false;
        } | {
            message: string;
            status: true;
        }>);
    }

    • cache: ((userId, channelId) => Promise<{
          message: string;
          status: false;
      } | {
          message: string;
          status: true;
      }>)
        • (userId, channelId): Promise<{
              message: string;
              status: false;
          } | {
              message: string;
              status: true;
          }>
        • Parameters

          • userId: string
          • channelId: string

          Returns Promise<{
              message: string;
              status: false;
          } | {
              message: string;
              status: true;
          }>

    • createDMChannel: ((userId) => Promise<null | string>)
        • (userId): Promise<null | string>
        • Parameters

          • userId: string

          Returns Promise<null | string>

    • get: ((userId, force?) => Promise<{
          message: string;
          status: false;
      } | {
          channelId: string;
          status: true;
      }>)
        • (userId, force?): Promise<{
              message: string;
              status: false;
          } | {
              channelId: string;
              status: true;
          }>
        • Parameters

          • userId: string
          • Optional force: boolean

          Returns Promise<{
              message: string;
              status: false;
          } | {
              channelId: string;
              status: true;
          }>

    • recache: (() => Promise<{
          message: string;
          status: false;
      } | {
          message: string;
          status: true;
      }>)
        • (): Promise<{
              message: string;
              status: false;
          } | {
              message: string;
              status: true;
          }>
        • Returns Promise<{
              message: string;
              status: false;
          } | {
              message: string;
              status: true;
          }>

    • remove: ((userId) => Promise<{
          message: string;
          status: false;
      } | {
          message: string;
          status: true;
      }>)
        • (userId): Promise<{
              message: string;
              status: false;
          } | {
              message: string;
              status: true;
          }>
        • Parameters

          • userId: string

          Returns Promise<{
              message: string;
              status: false;
          } | {
              message: string;
              status: true;
          }>

    • removeAllChannel: ((channelIds) => Promise<{
          message: string;
          status: false;
      } | {
          message: string;
          status: true;
      }>)
        • (channelIds): Promise<{
              message: string;
              status: false;
          } | {
              message: string;
              status: true;
          }>
        • Parameters

          • channelIds: string[]

          Returns Promise<{
              message: string;
              status: false;
          } | {
              message: string;
              status: true;
          }>

  • get id(): string
  • Returns string

Methods

  • Type Parameters

    • D

    • B = unknown

    Parameters

    • route: `/${string}`
    • Optional options: {
          auth?: boolean;
          body?: B;
          files?: RawFile[];
          method?: "get" | "post" | "patch" | "delete";
          query?: URLSearchParams;
          reason?: string;
      }
      • Optional auth?: boolean
      • Optional body?: B
      • Optional files?: RawFile[]
      • Optional method?: "get" | "post" | "patch" | "delete"
      • Optional query?: URLSearchParams
      • Optional reason?: string
    • Optional channelId: string

    Returns Promise<null | D>

  • Parameters

    • userId: string
    • Optional clientId: string

    Returns string

  • Parameters

    Returns Promise<null | {
        message: string;
        status: false;
    } | APIMessage>

  • Parameters

    • Optional handler: ((error) => null)
        • (error): null
        • Parameters

          • error: unknown

          Returns null

    Returns DMManager

Generated using TypeDoc