Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • BotManager

Index

Constructors

Properties

Methods

Constructors

constructor

  • 새로운 BotManager 인스턴스를 만듭니다.

    example
    new BotManager(
    new Koreanbots({
    // ...
    })),
    {
    cache: {
    maxSize: 150,
    sweepInterval: 60000
    }
    }
    )

    Parameters

    • koreanbots: Koreanbots
    • Optional options: BotManagerOptions

    Returns BotManager

Properties

cache

cache: LimitedCollection<string, Nullable<Bot>>

Readonly koreanbots

koreanbots: Koreanbots

Optional Readonly options

options?: BotManagerOptions

Methods

fetch

  • fetch(botID: string, options?: FetchOptions): Promise<Bot>
  • 봇을 불러옵니다.

    example
    koreanbots.bots.fetch("12345678901234567")
    .then(bot => console.log(`${bot.name} 봇을 불러왔습니다!`))
    .catch(err => console.error(`다음 오류로 인해 봇을 불러오는 것에 실패 했습니다. ${err.stack}`))
    example
    koreanbots.bots.fetch("12345678901234567", { force: true })
    .then(bot => console.log(`캐시를 무시하고 ${bot.name} 봇을 불러온 후, 캐시에 저장 했습니다.`))
    .catch(err => console.error(`다음 오류로 인해 봇을 불러오는 것에 실패 했습니다. ${err.stack}`))
    example
    koreanbots.bots.fetch("12345678901234567", { cache: false, force: true })
    .then(bot => console.log(`캐시를 무시하고 ${bot.name} 봇을 불러왔으며, 캐시에 저장하지 않았습니다.`))
    .catch(err => console.error(`다음 오류로 인해 봇을 불러오는 것에 실패 했습니다. ${err.stack}`))

    Parameters

    • botID: string
    • options: FetchOptions = ...

    Returns Promise<Bot>

Generated using TypeDoc