Explorar el Código

Deprecate BlockingBot.dispose

Him188 hace 6 años
padre
commit
12e62c8aee

+ 9 - 1
mirai-japt/src/main/java/net/mamoe/mirai/japt/BlockingBot.java

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

+ 1 - 1
mirai-japt/src/main/kotlin/net/mamoe/mirai/japt/internal/BlockingBotImpl.kt

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