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:
parent
3ce17cf9e1
commit
12e62c8aee
mirai-japt/src/main
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
Loading…
Reference in New Issue
Block a user