Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Koreanbots

Hierarchy

  • Koreanbots

Index

Constructors

Properties

Methods

Constructors

constructor

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

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

Private getOptions

  • getOptions(options?: BotManagerOptions): { cache: { api: RequestClientOptions; bots?: BotManagerOptions; clientID: string; max?: number; maxAge?: number; users?: BotManagerOptions; widgets?: BotManagerOptions } }
  • 로컬 캐시 옵션이 글로벌 캐시 옵션보다 우선권을 가지는 캐시 정책을 가진 옵션을 돌려줍니다.

    Parameters

    • Optional options: BotManagerOptions

    Returns { cache: { api: RequestClientOptions; bots?: BotManagerOptions; clientID: string; max?: number; maxAge?: number; users?: BotManagerOptions; widgets?: BotManagerOptions } }

    • cache: { api: RequestClientOptions; bots?: BotManagerOptions; clientID: string; max?: number; maxAge?: number; users?: BotManagerOptions; widgets?: BotManagerOptions }
      • api: RequestClientOptions
      • Optional bots?: BotManagerOptions
      • clientID: string
      • Optional max?: number
      • Optional maxAge?: number
      • Optional users?: BotManagerOptions
      • Optional widgets?: BotManagerOptions

Static validator

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

Generated using TypeDoc