Remove redundant args of BotSession

This commit is contained in:
Him188 2019-12-07 13:17:04 +08:00
parent c78c8ac46c
commit cb083922d8
2 changed files with 3 additions and 9 deletions

View File

@ -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) } }

View File

@ -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