Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Koreanbots

Index

Constructors

constructor

  • new Koreanbots(options: KoreanbotsOptions): Koreanbots
  • 새로운 Koreanbots 인스턴스를 생성합니다.

    example
    new Koreanbots({
    clientID: process.env.CLIENT_ID,
    api: {
    token: process.env.KOREANBOTS_TOKEN
    },
    // 글로벌 캐시 옵션이며, 누락할 경우 모든 캐시 옵션이 각각의 기본 값으로 설정됩니다 (로컬 캐시 옵션이 우선권을 가집니다)
    maxSize: 250, // (기본값: 100) 캐시에 최대 250개의 내용을 저장
    sweepInterval: 60000 * 15, // (기본값: 10000 = 10초) 캐시에 저장한 내용을 15분 뒤에 삭제합니다.
    users: {
    cache: { // 이 캐시 설정은 로컬이므로 앞서 적은 글로벌 캐시 옵션보다 우선권을 갖습니다.
    maxSize: 500, // (기본값: 100)
    sweepInterval: 60000 * 30 // (기본값: 60000 * 60)
    }
    }
    })

    Parameters

    • options: KoreanbotsOptions

      옵션

    Returns Koreanbots

Properties

Readonly api

api: Proxy

bots

mybot

mybot: Mybot

Readonly options

options: KoreanbotsOptions

users

widgets

widgets: WidgetManager

Methods

destroy

  • destroy(): void

Private getOptions

  • getOptions(options?: BotManagerOptions): { cache: { api: RequestClientOptions; bots?: BotManagerOptions; clientID: string; maxSize?: number; sweepFilter?: SweepFilter<string, Nullable<Bot>>; sweepInterval?: number; users?: BotManagerOptions; widgets?: BotManagerOptions; keepOverLimit?: any } }
  • 로컬 캐시 옵션이 글로벌 캐시 옵션보다 우선권을 가지는 캐시 정책을 가진 옵션을 돌려줍니다.

    Parameters

    • Optional options: BotManagerOptions

    Returns { cache: { api: RequestClientOptions; bots?: BotManagerOptions; clientID: string; maxSize?: number; sweepFilter?: SweepFilter<string, Nullable<Bot>>; sweepInterval?: number; users?: BotManagerOptions; widgets?: BotManagerOptions; keepOverLimit?: any } }

    • cache: { api: RequestClientOptions; bots?: BotManagerOptions; clientID: string; maxSize?: number; sweepFilter?: SweepFilter<string, Nullable<Bot>>; sweepInterval?: number; users?: BotManagerOptions; widgets?: BotManagerOptions; keepOverLimit?: any }
      • api: RequestClientOptions
      • Optional bots?: BotManagerOptions
      • clientID: string
      • Optional maxSize?: number
      • Optional sweepFilter?: SweepFilter<string, Nullable<Bot>>
      • Optional sweepInterval?: number
      • Optional users?: BotManagerOptions
      • Optional widgets?: BotManagerOptions
      • keepOverLimit?:function
        • keepOverLimit(value: V, key: K, collection: LimitedCollection<K, V>): boolean
        • Parameters

          • value: V
          • key: K
          • collection: LimitedCollection<K, V>

          Returns boolean

Static validator

  • validator<T>(): ProxyValidator<T>

Generated using TypeDoc