mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-24 23:20:09 +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)
|
@UseExperimental(MiraiInternalAPI::class)
|
||||||
actual class BotSession internal actual constructor(
|
actual class BotSession internal actual constructor(
|
||||||
bot: Bot,
|
bot: Bot
|
||||||
sessionKey: SessionKey,
|
) : BotSessionBase(bot) {
|
||||||
socket: DataPacketSocketAdapter,
|
|
||||||
NetworkScope: CoroutineScope
|
|
||||||
) : BotSessionBase(bot, sessionKey, socket, NetworkScope) {
|
|
||||||
|
|
||||||
suspend inline fun Image.downloadAsStream(): InputStream = download().inputStream()
|
suspend inline fun Image.downloadAsStream(): InputStream = download().inputStream()
|
||||||
suspend inline fun Image.downloadAsBitmap(): Bitmap = withContext(Dispatchers.IO) { downloadAsStream().use { BitmapFactory.decodeStream(it) } }
|
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 bot: Bot = Bot(qq, "", coroutineContext)
|
||||||
override val session = BotSession(
|
override val session = BotSession(bot)
|
||||||
bot, sessionKey,
|
|
||||||
socket, this
|
|
||||||
)
|
|
||||||
|
|
||||||
override suspend fun login(): LoginResult = LoginResult.SUCCESS
|
override suspend fun login(): LoginResult = LoginResult.SUCCESS
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user