All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ly-api.0.0.3-t3.source-code.BiliBotFactory.kt Maven / Gradle / Ivy

There is a newer version: 0.0.4-dev-1
Show newest version
package com.elouyi.bely

import com.elouyi.bely.config.BotConfigurationBuilder
import com.elouyi.bely.contact.BiliBot
import com.elouyi.bely.contact.WebBiliBot

/**
 * 构造 [BiliBot] 的方式
 *
 * examples:
 * ```kotlin
 * val bot = BiliBotFactory.newBot(uid){  // this: BotConfigurationBuilder
 *  ...
 * }
 * ```
 */
interface BiliBotFactory {

    fun newWebBot(uid: Long, config: BotConfigurationBuilder.() -> Unit = {}): WebBiliBot

    fun newAppBot(uid: Long, config: BotConfigurationBuilder.() -> Unit = {}): BiliBot

    companion object : BiliBotFactory {
        override fun newWebBot(uid: Long, config: BotConfigurationBuilder.() -> Unit): WebBiliBot =
            BEly.botFactory.newWebBot(uid, config)

        override fun newAppBot(uid: Long, config: BotConfigurationBuilder.() -> Unit): BiliBot =
            BEly.botFactory.newAppBot(uid, config)

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy