Merge pull request #52 from Karlatemp/patch-1

修正removeManager的错误
This commit is contained in:
Him188 2020-04-15 18:19:39 +08:00 committed by GitHub
commit 9e605afcea
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
}
}