Docs update

This commit is contained in:
Him188 2019-11-02 01:17:48 +08:00
parent e2d04f7113
commit e58665f93e
3 changed files with 8 additions and 4 deletions

View File

@ -50,7 +50,7 @@ inline fun <R> Bot.withSession(block: BotSession.() -> R): R = with(this.network
suspend inline fun Bot.sendPacket(packet: OutgoingPacket) = this.network.sendPacket(packet)
/**
* 使用在默认配置基础上修改的配置登录
* 使用在默认配置基础上修改的配置进行登录
*/
suspend inline fun Bot.login(noinline configuration: BotNetworkConfiguration.() -> Unit): LoginResult = this.network.login(BotNetworkConfiguration().apply(configuration))

View File

@ -65,7 +65,7 @@ inline class GroupInternalId(val value: UInt)
@Suppress("MemberVisibilityCanBePrivate", "CanBeParameter")
class Group internal constructor(bot: Bot, val groupId: GroupId) : Contact(bot, groupId.value) {
val internalId = GroupId(id).toInternalId()
val members: ContactList<QQ>
val members: ContactList<Member>
get() = TODO("Implementing group members is less important")
override suspend fun sendMessage(message: MessageChain) {
@ -75,6 +75,10 @@ class Group internal constructor(bot: Bot, val groupId: GroupId) : Contact(bot,
companion object
}
/**
* [BotSession] 作为接收器 (receiver) 并调用 [block], 返回 [block] 的返回值.
* 这个方法将能帮助使用在 [BotSession] 中定义的一些扩展方法, [BotSession.sendAndExpect]
*/
inline fun <R> Contact.withSession(block: BotSession.() -> R): R = bot.withSession(block)
/**

View File

@ -417,7 +417,7 @@ class EmptyMessageChain : MessageChain {
* Null [MessageChain].
* 它不包含任何元素, 也没有创建任何 list.
*
* - 所有 get 方法均抛出 [NoSuchElementException]
* - 所有 get 方法均抛出 [IndexOutOfBoundsException]
* - 所有 add 方法均抛出 [UnsupportedOperationException]
* - 其他判断类方法均 false -1
*/
@ -434,7 +434,7 @@ object NullMessageChain : MessageChain {
override fun concat(tail: Message): MessageChain = MessageChainImpl(tail)
override val size: Int = 0
override fun containsAll(elements: Collection<Message>): Boolean = false
override fun get(index: Int): Message = throw NoSuchElementException()
override fun get(index: Int): Message = throw IndexOutOfBoundsException()
override fun indexOf(element: Message): Int = -1
override fun isEmpty(): Boolean = true
override fun iterator(): MutableIterator<Message> = EmptyMutableIterator()