mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-09 09:50:16 +08:00
Remove redundant args of BotSession
This commit is contained in:
parent
c78c8ac46c
commit
cb083922d8
@ -21,11 +21,8 @@ import java.io.InputStream
|
||||
*/
|
||||
@UseExperimental(MiraiInternalAPI::class)
|
||||
actual class BotSession internal actual constructor(
|
||||
bot: Bot,
|
||||
sessionKey: SessionKey,
|
||||
socket: DataPacketSocketAdapter,
|
||||
NetworkScope: CoroutineScope
|
||||
) : BotSessionBase(bot, sessionKey, socket, NetworkScope) {
|
||||
bot: Bot
|
||||
) : BotSessionBase(bot) {
|
||||
|
||||
suspend inline fun Image.downloadAsStream(): InputStream = download().inputStream()
|
||||
suspend inline fun Image.downloadAsBitmap(): Bitmap = withContext(Dispatchers.IO) { downloadAsStream().use { BitmapFactory.decodeStream(it) } }
|
||||
|
@ -316,10 +316,7 @@ internal object DebugNetworkHandler : BotNetworkHandler<DataPacketSocketAdapter>
|
||||
|
||||
}
|
||||
override val bot: Bot = Bot(qq, "", coroutineContext)
|
||||
override val session = BotSession(
|
||||
bot, sessionKey,
|
||||
socket, this
|
||||
)
|
||||
override val session = BotSession(bot)
|
||||
|
||||
override suspend fun login(): LoginResult = LoginResult.SUCCESS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user