修正removeManager的错误

修正removeManager的错误
This commit is contained in:
Karlatemp 2020-04-15 17:21:43 +08:00 committed by GitHub
parent 1e2b85b737
commit 9f483049c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ fun Bot.addManager(long: Long) {
fun Bot.removeManager(long: Long) {
BOT_MANAGERS.putIfAbsent(this.id.toString(), mutableListOf<Long>())
BOT_MANAGERS[this.id.toString()] =
(BOT_MANAGERS.getLongList(this.id.toString()) as MutableList<Long>).apply { add(long) }
(BOT_MANAGERS.getLongList(this.id.toString()) as MutableList<Long>).apply { remove(long) }
BotManagers.config.save()
}
@ -50,4 +50,4 @@ fun Bot.checkManager(long: Long): Boolean {
fun getBotManagers(bot:Bot):List<Long>{
return bot.managers
}
}