chore: improve niuzi bank command
This commit is contained in:
8 files changed
+50
-34
No files matched your search
@@ -7,9 +7,15 @@
|
||||
|
||||
package cn.rtast.fancybot.util
|
||||
|
||||
import cn.rtast.rob.util.ob.OneBotListener
|
||||
import kotlin.random.Random
|
||||
|
||||
fun randomBooleanWithProbability(probability: Double): Boolean {
|
||||
val randomValue = Random.nextInt(100)
|
||||
return randomValue <= (probability * 100)
|
||||
}
|
||||
|
||||
suspend fun OneBotListener.getUserName(groupId: Long, userId: Long): String {
|
||||
val info = this.getGroupMemberInfo(groupId, userId)
|
||||
return info.card ?: info.nickname
|
||||
}
|
||||
Reference in New Issue
Block a user