Class BotCollection

Collection of Bots

Hierarchy

Constructors

Properties

#objects: ReactiveMap<string, Bot> = ...
#storage: ObjectStorage<HydratedBot> = ...
client: Client
getUnderlyingObject: ((id) => HydratedBot)

Type declaration

    • (id): HydratedBot
    • Parameters

      • id: string

      Returns HydratedBot

updateUnderlyingObject: SetStoreFunction<Record<string, HydratedBot>>

Methods

  • Create a new instance of an object

    Parameters

    • id: string

      Id

    • type: "user" | "server" | "channel" | "bot" | "channelUnread" | "channelWebhook" | "emoji" | "message" | "serverMember" | "session"

      Type

    • instance: Bot

      Instance

    • context: unknown

      Context

    • Optional data: unknown

      Data

    Returns void

  • Find some value based on a predicate

    Parameters

    • predicate: ((value, key) => boolean)

      Predicate to satisfy

        • (value, key): boolean
        • Parameters

          • value: Bot
          • key: string

          Returns boolean

    Returns undefined | Bot

  • Execute a provided function over each key, value pair in the map

    Parameters

    • cb: ((value, key, map) => void)

      Callback for each pair

        • (value, key, map): void
        • Parameters

          • value: Bot
          • key: string
          • map: ReactiveMap<string, Bot>

          Returns void

    Returns void

    Iterable

  • Get or create

    Parameters

    • id: string

      Id

    • data: {
          _id: string;
          analytics?: boolean;
          discoverable?: boolean;
          flags?: number;
          interactions_url?: string;
          owner: string;
          privacy_policy_url?: string;
          public: boolean;
          terms_of_service_url?: string;
          token: string;
      }

      Data

      • _id: string

        Description

        Bot Id

      • Optional analytics?: boolean

        Description

        Whether to enable analytics

      • Optional discoverable?: boolean

        Description

        Whether this bot should be publicly discoverable

      • Optional flags?: number

        Format: uint32

        Description

        Enum of bot flags

      • Optional interactions_url?: string

        Description

        Reserved; URL for handling interactions

      • owner: string

        Description

        User Id of the bot owner

      • Optional privacy_policy_url?: string

        Description

        URL for privacy policy

      • public: boolean

        Description

        Whether the bot is public (may be invited by anyone)

      • Optional terms_of_service_url?: string

        Description

        URL for terms of service

      • token: string

        Description

        Token used to authenticate requests for this bot

    Returns Bot

    Bot

  • Map the collection using a given callback

    Type Parameters

    • O

    Parameters

    • cb: ((value, key) => O)

      Callback

        • (value, key): O
        • Parameters

          • value: Bot
          • key: string

          Returns O

    Returns O[]

Generated using TypeDoc