Skip to content

Commit

Permalink
fix: logger
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed Aug 9, 2021
1 parent 643bb22 commit 6cc6722
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/main/kotlin/xyz/cssxsh/mirai/plugin/ArknightsTools.kt
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
package xyz.cssxsh.mirai.plugin

import net.mamoe.mirai.Bot
import net.mamoe.mirai.console.command.CommandSenderOnMessage
import net.mamoe.mirai.contact.Contact
import net.mamoe.mirai.contact.Group
import net.mamoe.mirai.contact.getMember
import net.mamoe.mirai.*
import net.mamoe.mirai.console.command.*
import net.mamoe.mirai.contact.*
import net.mamoe.mirai.message.data.*
import net.mamoe.mirai.message.data.MessageSource.Key.quote
import net.mamoe.mirai.message.nextMessage
import net.mamoe.mirai.message.*
import net.mamoe.mirai.utils.*
import xyz.cssxsh.arknights.excel.*
import xyz.cssxsh.arknights.*
import xyz.cssxsh.arknights.market.*
import xyz.cssxsh.arknights.mine.*
import xyz.cssxsh.arknights.penguin.*
import java.time.Duration
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty
import java.time.*
import kotlin.properties.*
import kotlin.reflect.*

internal val logger by ArknightsHelperPlugin::logger
internal val logger by lazy {
val open = System.getProperty("xyz.cssxsh.mirai.plugin.logger", "${true}").toBoolean()
if (open) ArknightsHelperPlugin.logger else SilentLogger
}

internal suspend fun <T : CommandSenderOnMessage<*>> T.nextContent(): String {
return fromEvent.nextMessage { it.message.content.isNotBlank() }.content
Expand Down

0 comments on commit 6cc6722

Please sign in to comment.