Commit e42f925b authored by Him188's avatar Him188

Add shortcuts for creating BotAccount and Bot

parent 6817d8b9
......@@ -21,9 +21,12 @@ import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.coroutineContext
import kotlin.jvm.JvmOverloads
@Suppress("NOTHING_TO_INLINE", "FunctionName")
inline fun BotAccount(id: Long, password: String): BotAccount = BotAccount(id.toUInt(), password)
data class BotAccount(
val id: UInt,
val password: String//todo 不保存 password?
val password: String
)
@Suppress("FunctionName")
......@@ -35,6 +38,9 @@ suspend inline fun Bot(account: BotAccount): Bot = Bot(account, coroutineContext
@Suppress("FunctionName")
suspend inline fun Bot(qq: UInt, password: String): Bot = Bot(qq, password, coroutineContext)
@Suppress("FunctionName")
suspend inline fun Bot(qq: Long, password: String): Bot = Bot(qq.toUInt(), password, coroutineContext)
/**
* Mirai 的机器人. 一个机器人实例登录一个 QQ 账号.
* Mirai 为多账号设计, 可同时维护多个机器人.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment