mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-27 17:00:14 +08:00
Add Group.getMember and Group.getMemberOrFail as disambiguation with get in some contexts.
This commit is contained in:
parent
c4791b0a5f
commit
08b46a487c
@ -7,7 +7,7 @@
|
||||
* https://github.com/mamoe/mirai/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
@file:Suppress("EXPERIMENTAL_API_USAGE", "unused", "UnusedImport")
|
||||
@file:Suppress("EXPERIMENTAL_API_USAGE", "unused", "UnusedImport", "NOTHING_TO_INLINE")
|
||||
|
||||
package net.mamoe.mirai.contact
|
||||
|
||||
@ -242,6 +242,18 @@ public interface GroupSettings {
|
||||
public val isAnonymousChatEnabled: Boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* 同 [get]. 在一些不适合使用 [get] 的情境下使用 [getMember].
|
||||
*/
|
||||
@JvmSynthetic
|
||||
public inline fun Group.getMember(id: Long): NormalMember? = get(id)
|
||||
|
||||
/**
|
||||
* 同 [getMemberOrFail]. 在一些不适合使用 [getOrFail] 的情境下使用 [getMemberOrFail].
|
||||
*/
|
||||
@JvmSynthetic
|
||||
public inline fun Group.getMemberOrFail(id: Long): NormalMember = getOrFail(id)
|
||||
|
||||
|
||||
/**
|
||||
* 返回机器人是否正在被禁言
|
||||
|
Loading…
Reference in New Issue
Block a user