Class BotCollection

Collection of Bots

Hierarchy (View Summary)

Constructors

Properties

client: Client
getUnderlyingObject: (id: string) => 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

    • Optionaldata: unknown

      Data

    Returns void

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

    Parameters

    • cb: (value: Bot, key: string, map: Map<string, Bot>) => void

      Callback for each pair

    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

        Bot Id

      • Optionalanalytics?: boolean

        Whether to enable analytics

      • Optionaldiscoverable?: boolean

        Whether this bot should be publicly discoverable

      • Optionalflags?: number

        Format: uint32

        Enum of bot flags

      • Optionalinteractions_url?: string

        Reserved; URL for handling interactions

      • owner: string

        User Id of the bot owner

      • Optionalprivacy_policy_url?: string

        URL for privacy policy

      • public: boolean

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

      • Optionalterms_of_service_url?: string

        URL for terms of service

      • token: string

        Token used to authenticate requests for this bot

    Returns Bot

    Bot