Commit 12e62c8a authored by Him188's avatar Him188

Deprecate BlockingBot.dispose

parent 3ce17cf9
...@@ -184,5 +184,13 @@ public interface BlockingBot { ...@@ -184,5 +184,13 @@ public interface BlockingBot {
/** /**
* 关闭这个 [Bot], 停止一切相关活动. 不可重新登录. * 关闭这个 [Bot], 停止一切相关活动. 不可重新登录.
*/ */
void dispose(@Nullable Throwable throwable); void close(@Nullable Throwable throwable);
/**
* @deprecated 使用 {@link #close(Throwable)}
*/
@Deprecated
default void dispose(@Nullable Throwable throwable) {
close(throwable);
}
} }
...@@ -65,5 +65,5 @@ internal class BlockingBotImpl(private val bot: Bot) : BlockingBot { ...@@ -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 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 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)
} }
\ No newline at end of file
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