1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-04-01 12:20:12 +08:00

Deprecate BlockingBot.dispose

This commit is contained in:
Him188 2020-02-19 10:28:10 +08:00
parent 3ce17cf9e1
commit 12e62c8aee
2 changed files with 10 additions and 2 deletions
mirai-japt/src/main
java/net/mamoe/mirai/japt
kotlin/net/mamoe/mirai/japt/internal

View File

@ -184,5 +184,13 @@ public interface BlockingBot {
/**
* 关闭这个 [Bot], 停止一切相关活动. 不可重新登录.
*/
void dispose(@Nullable Throwable throwable);
void close(@Nullable Throwable throwable);
/**
* @deprecated 使用 {@link #close(Throwable)}
*/
@Deprecated
default void dispose(@Nullable Throwable throwable) {
close(throwable);
}
}

View File

@ -65,5 +65,5 @@ internal class BlockingBotImpl(private val bot: Bot) : BlockingBot {
override fun addFriend(id: Long, message: String?, remark: String?): AddFriendResult = runBlocking { bot.addFriend(id, message, remark) }
override fun approveFriendAddRequest(id: Long, remark: String?) = runBlocking { bot.approveFriendAddRequest(id, remark) }
override fun dispose(throwable: Throwable?) = bot.close(throwable)
override fun close(throwable: Throwable?) = bot.close(throwable)
}