mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-20 17:29:32 +08:00
Add Message.repeat
, make Message.times
inline
This commit is contained in:
parent
1998b53451
commit
e3576fe5d0
@ -7,7 +7,7 @@
|
||||
* https://github.com/mamoe/mirai/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
@file:Suppress("MemberVisibilityCanBePrivate", "unused", "EXPERIMENTAL_API_USAGE")
|
||||
@file:Suppress("MemberVisibilityCanBePrivate", "unused", "EXPERIMENTAL_API_USAGE", "NOTHING_TO_INLINE")
|
||||
|
||||
package net.mamoe.mirai.message.data
|
||||
|
||||
@ -115,12 +115,14 @@ suspend inline fun <C : Contact> Message.sendTo(contact: C): MessageReceipt<C> {
|
||||
return contact.sendMessage(this)
|
||||
}
|
||||
|
||||
operator fun Message.times(count: Int): MessageChain {
|
||||
fun Message.repeat(count: Int): MessageChain {
|
||||
return buildMessageChain(count) {
|
||||
add(this@times)
|
||||
add(this@repeat)
|
||||
}
|
||||
}
|
||||
|
||||
inline operator fun Message.times(count: Int): MessageChain = this.repeat(count)
|
||||
|
||||
interface SingleMessage : Message
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user