Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
84cfe262
Commit
84cfe262
authored
May 05, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove all `@SinceMirai("0.x.x")`
parent
4ee27f20
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
0 additions
and
157 deletions
+0
-157
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/list/ProfileService.kt
.../qqandroid/network/protocol/packet/list/ProfileService.kt
+0
-3
mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/Group.kt
...e/src/androidMain/kotlin/net/mamoe/mirai/contact/Group.kt
+0
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt
+0
-11
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/ContactOrBot.kt
...commonMain/kotlin/net.mamoe.mirai/contact/ContactOrBot.kt
+0
-2
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Exceptions.kt
...c/commonMain/kotlin/net.mamoe.mirai/contact/Exceptions.kt
+0
-3
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Group.kt
...re/src/commonMain/kotlin/net.mamoe.mirai/contact/Group.kt
+0
-4
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Member.kt
...e/src/commonMain/kotlin/net.mamoe.mirai/contact/Member.kt
+0
-7
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/MemberPermission.kt
...onMain/kotlin/net.mamoe.mirai/contact/MemberPermission.kt
+0
-2
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/data/GroupActiveData.kt
...commonMain/kotlin/net.mamoe.mirai/data/GroupActiveData.kt
+0
-2
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt
...mmonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt
+0
-15
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/linear.kt
...ore/src/commonMain/kotlin/net.mamoe.mirai/event/linear.kt
+0
-5
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/select.kt
...ore/src/commonMain/kotlin/net.mamoe.mirai/event/select.kt
+0
-6
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/subscribeMessages.kt
...monMain/kotlin/net.mamoe.mirai/event/subscribeMessages.kt
+0
-2
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/subscriber.kt
...src/commonMain/kotlin/net.mamoe.mirai/event/subscriber.kt
+0
-6
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/lowLevelApi.kt
...core/src/commonMain/kotlin/net.mamoe.mirai/lowLevelApi.kt
+0
-6
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/MessageEvent.kt
...commonMain/kotlin/net.mamoe.mirai/message/MessageEvent.kt
+0
-2
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/TempMessageEvent.kt
...onMain/kotlin/net.mamoe.mirai/message/TempMessageEvent.kt
+0
-2
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/AtAll.kt
...c/commonMain/kotlin/net.mamoe.mirai/message/data/AtAll.kt
+0
-3
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/CustomMessage.kt
...Main/kotlin/net.mamoe.mirai/message/data/CustomMessage.kt
+0
-2
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/ForwardMessage.kt
...ain/kotlin/net.mamoe.mirai/message/data/ForwardMessage.kt
+0
-8
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/HummerMessage.kt
...Main/kotlin/net.mamoe.mirai/message/data/HummerMessage.kt
+0
-11
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Image.kt
...c/commonMain/kotlin/net.mamoe.mirai/message/data/Image.kt
+0
-5
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Message.kt
...commonMain/kotlin/net.mamoe.mirai/message/data/Message.kt
+0
-9
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt
...nMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt
+0
-3
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChainBuilder.kt
...otlin/net.mamoe.mirai/message/data/MessageChainBuilder.kt
+0
-2
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageSource.kt
...Main/kotlin/net.mamoe.mirai/message/data/MessageSource.kt
+0
-7
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageSourceBuilder.kt
...tlin/net.mamoe.mirai/message/data/MessageSourceBuilder.kt
+0
-6
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/QuoteReply.kt
...monMain/kotlin/net.mamoe.mirai/message/data/QuoteReply.kt
+0
-3
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/RichMessage.kt
...onMain/kotlin/net.mamoe.mirai/message/data/RichMessage.kt
+0
-13
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/BotConfiguration.kt
...mmonMain/kotlin/net.mamoe.mirai/utils/BotConfiguration.kt
+0
-4
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/SoftRef.kt
...re/src/commonMain/kotlin/net.mamoe.mirai/utils/SoftRef.kt
+0
-1
mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/LoginSolver.swing.jvm.kt
...ain/kotlin/net/mamoe/mirai/utils/LoginSolver.swing.jvm.kt
+0
-1
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/list/ProfileService.kt
View file @
84cfe262
...
@@ -24,11 +24,8 @@ import net.mamoe.mirai.qqandroid.utils.io.serialization.jceRequestSBuffer
...
@@ -24,11 +24,8 @@ import net.mamoe.mirai.qqandroid.utils.io.serialization.jceRequestSBuffer
import
net.mamoe.mirai.qqandroid.utils.io.serialization.readUniPacket
import
net.mamoe.mirai.qqandroid.utils.io.serialization.readUniPacket
import
net.mamoe.mirai.qqandroid.utils.io.serialization.writeJceStruct
import
net.mamoe.mirai.qqandroid.utils.io.serialization.writeJceStruct
import
net.mamoe.mirai.qqandroid.utils.toByteArray
import
net.mamoe.mirai.qqandroid.utils.toByteArray
import
net.mamoe.mirai.utils.SinceMirai
internal
class
ProfileService
{
internal
class
ProfileService
{
@SinceMirai
(
"0.37.0"
)
object
GroupMngReq
:
OutgoingPacketFactory
<
GroupMngReq
.
GroupMngReqResponse
>(
"ProfileService.GroupMngReq"
)
{
object
GroupMngReq
:
OutgoingPacketFactory
<
GroupMngReq
.
GroupMngReqResponse
>(
"ProfileService.GroupMngReq"
)
{
data class
GroupMngReqResponse
(
val
errorCode
:
Int
,
val
errorMessage
:
String
)
:
Packet
data class
GroupMngReqResponse
(
val
errorCode
:
Int
,
val
errorMessage
:
String
)
:
Packet
...
...
mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/Group.kt
View file @
84cfe262
...
@@ -42,7 +42,6 @@ actual abstract class Group : Contact(), CoroutineScope {
...
@@ -42,7 +42,6 @@ actual abstract class Group : Contact(), CoroutineScope {
/**
/**
* 群设置
* 群设置
*/
*/
@SinceMirai
(
"0.30.0"
)
actual
abstract
val
settings
:
GroupSettings
actual
abstract
val
settings
:
GroupSettings
/**
/**
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt
View file @
84cfe262
...
@@ -64,7 +64,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
...
@@ -64,7 +64,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
/**
/**
* 复制一份此时的 [Bot] 实例列表.
* 复制一份此时的 [Bot] 实例列表.
*/
*/
@SinceMirai
(
"0.39.1"
)
@JvmStatic
@JvmStatic
val
botInstances
:
List
<
Bot
>
val
botInstances
:
List
<
Bot
>
get
()
=
BotImpl
.
instances
.
asSequence
().
mapNotNull
{
it
.
get
()
}.
toList
()
get
()
=
BotImpl
.
instances
.
asSequence
().
mapNotNull
{
it
.
get
()
}.
toList
()
...
@@ -92,13 +91,11 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
...
@@ -92,13 +91,11 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
/**
/**
* QQ 号码. 实际类型为 uint
* QQ 号码. 实际类型为 uint
*/
*/
@SinceMirai
(
"0.32.0"
)
abstract
override
val
id
:
Long
abstract
override
val
id
:
Long
/**
/**
* 昵称
* 昵称
*/
*/
@SinceMirai
(
"0.33.1"
)
abstract
val
nick
:
String
abstract
val
nick
:
String
/**
/**
...
@@ -191,7 +188,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
...
@@ -191,7 +188,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
* @param targetUin 为用户时为 [Friend.id], 为群时需使用 [Group.calculateGroupUinByGroupCode] 计算
* @param targetUin 为用户时为 [Friend.id], 为群时需使用 [Group.calculateGroupUinByGroupCode] 计算
*/
*/
@MiraiExperimentalAPI
@MiraiExperimentalAPI
@SinceMirai
(
"0.39.0"
)
abstract
fun
constructMessageSource
(
abstract
fun
constructMessageSource
(
kind
:
OfflineMessageSource
.
Kind
,
kind
:
OfflineMessageSource
.
Kind
,
fromUin
:
Long
,
targetUin
:
Long
,
fromUin
:
Long
,
targetUin
:
Long
,
...
@@ -205,7 +201,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
...
@@ -205,7 +201,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
*
*
* @param event 好友验证的事件对象
* @param event 好友验证的事件对象
*/
*/
@SinceMirai
(
"0.35.0"
)
@JvmSynthetic
@JvmSynthetic
abstract
suspend
fun
acceptNewFriendRequest
(
event
:
NewFriendRequestEvent
)
abstract
suspend
fun
acceptNewFriendRequest
(
event
:
NewFriendRequestEvent
)
...
@@ -215,7 +210,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
...
@@ -215,7 +210,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
* @param event 好友验证的事件对象
* @param event 好友验证的事件对象
* @param blackList 拒绝后是否拉入黑名单
* @param blackList 拒绝后是否拉入黑名单
*/
*/
@SinceMirai
(
"0.35.0"
)
@JvmSynthetic
@JvmSynthetic
abstract
suspend
fun
rejectNewFriendRequest
(
event
:
NewFriendRequestEvent
,
blackList
:
Boolean
=
false
)
abstract
suspend
fun
rejectNewFriendRequest
(
event
:
NewFriendRequestEvent
,
blackList
:
Boolean
=
false
)
...
@@ -224,7 +218,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
...
@@ -224,7 +218,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
*
*
* @param event 加群验证的事件对象
* @param event 加群验证的事件对象
*/
*/
@SinceMirai
(
"0.35.0"
)
@JvmSynthetic
@JvmSynthetic
abstract
suspend
fun
acceptMemberJoinRequest
(
event
:
MemberJoinRequestEvent
)
abstract
suspend
fun
acceptMemberJoinRequest
(
event
:
MemberJoinRequestEvent
)
...
@@ -234,7 +227,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
...
@@ -234,7 +227,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
* @param event 加群验证的事件对象
* @param event 加群验证的事件对象
* @param blackList 拒绝后是否拉入黑名单
* @param blackList 拒绝后是否拉入黑名单
*/
*/
@SinceMirai
(
"0.35.0"
)
@JvmSynthetic
@JvmSynthetic
abstract
suspend
fun
rejectMemberJoinRequest
(
event
:
MemberJoinRequestEvent
,
blackList
:
Boolean
=
false
)
abstract
suspend
fun
rejectMemberJoinRequest
(
event
:
MemberJoinRequestEvent
,
blackList
:
Boolean
=
false
)
...
@@ -244,7 +236,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
...
@@ -244,7 +236,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
* @param event 加群验证的事件对象
* @param event 加群验证的事件对象
* @param blackList 忽略后是否拉入黑名单
* @param blackList 忽略后是否拉入黑名单
*/
*/
@SinceMirai
(
"0.35.0"
)
@JvmSynthetic
@JvmSynthetic
abstract
suspend
fun
ignoreMemberJoinRequest
(
event
:
MemberJoinRequestEvent
,
blackList
:
Boolean
=
false
)
abstract
suspend
fun
ignoreMemberJoinRequest
(
event
:
MemberJoinRequestEvent
,
blackList
:
Boolean
=
false
)
...
@@ -253,7 +244,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
...
@@ -253,7 +244,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
*
*
* @param event 邀请入群的事件对象
* @param event 邀请入群的事件对象
*/
*/
@SinceMirai
(
"0.39.4"
)
@JvmSynthetic
@JvmSynthetic
abstract
suspend
fun
acceptInvitedJoinGroupRequest
(
event
:
BotInvitedJoinGroupRequestEvent
)
abstract
suspend
fun
acceptInvitedJoinGroupRequest
(
event
:
BotInvitedJoinGroupRequestEvent
)
...
@@ -263,7 +253,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
...
@@ -263,7 +253,6 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
* @param event 邀请入群的事件对象
* @param event 邀请入群的事件对象
*/
*/
@JvmSynthetic
@JvmSynthetic
@SinceMirai
(
"0.39.4"
)
abstract
suspend
fun
ignoreInvitedJoinGroupRequest
(
event
:
BotInvitedJoinGroupRequestEvent
)
abstract
suspend
fun
ignoreInvitedJoinGroupRequest
(
event
:
BotInvitedJoinGroupRequestEvent
)
// endregion
// endregion
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/ContactOrBot.kt
View file @
84cfe262
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
package
net.mamoe.mirai.contact
package
net.mamoe.mirai.contact
import
net.mamoe.mirai.Bot
import
net.mamoe.mirai.Bot
import
net.mamoe.mirai.utils.SinceMirai
/**
/**
* 拥有 [id] 的对象.
* 拥有 [id] 的对象.
...
@@ -19,7 +18,6 @@ import net.mamoe.mirai.utils.SinceMirai
...
@@ -19,7 +18,6 @@ import net.mamoe.mirai.utils.SinceMirai
* @see Contact
* @see Contact
* @see Bot
* @see Bot
*/
*/
@SinceMirai
(
"0.39.0"
)
interface
ContactOrBot
{
interface
ContactOrBot
{
/**
/**
* QQ 号或群号.
* QQ 号或群号.
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Exceptions.kt
View file @
84cfe262
...
@@ -12,14 +12,12 @@
...
@@ -12,14 +12,12 @@
package
net.mamoe.mirai.contact
package
net.mamoe.mirai.contact
import
net.mamoe.mirai.message.data.Message
import
net.mamoe.mirai.message.data.Message
import
net.mamoe.mirai.utils.SinceMirai
/**
/**
* 发送消息时消息过长抛出的异常.
* 发送消息时消息过长抛出的异常.
*
*
* @see Contact.sendMessage
* @see Contact.sendMessage
*/
*/
@SinceMirai
(
"0.32.0"
)
class
MessageTooLargeException
(
class
MessageTooLargeException
(
val
target
:
Contact
,
val
target
:
Contact
,
/**
/**
...
@@ -38,7 +36,6 @@ class MessageTooLargeException(
...
@@ -38,7 +36,6 @@ class MessageTooLargeException(
*
*
* @see Group.sendMessage
* @see Group.sendMessage
*/
*/
@SinceMirai
(
"0.33.0"
)
class
BotIsBeingMutedException
(
class
BotIsBeingMutedException
(
val
target
:
Group
val
target
:
Group
)
:
RuntimeException
(
"bot is being muted, remaining ${target.botMuteRemaining} seconds"
)
)
:
RuntimeException
(
"bot is being muted, remaining ${target.botMuteRemaining} seconds"
)
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Group.kt
View file @
84cfe262
...
@@ -47,7 +47,6 @@ abstract class Group : Contact(), CoroutineScope {
...
@@ -47,7 +47,6 @@ abstract class Group : Contact(), CoroutineScope {
/**
/**
* 群设置
* 群设置
*/
*/
@SinceMirai
(
"0.30.0"
)
abstract
val
settings
:
GroupSettings
abstract
val
settings
:
GroupSettings
/**
/**
...
@@ -122,7 +121,6 @@ abstract class Group : Contact(), CoroutineScope {
...
@@ -122,7 +121,6 @@ abstract class Group : Contact(), CoroutineScope {
* @return 退出成功时 true; 已经退出时 false
* @return 退出成功时 true; 已经退出时 false
*/
*/
@JvmSynthetic
@JvmSynthetic
@SinceMirai
(
"0.37.0"
)
abstract
suspend
fun
quit
():
Boolean
abstract
suspend
fun
quit
():
Boolean
/**
/**
...
@@ -196,7 +194,6 @@ abstract class Group : Contact(), CoroutineScope {
...
@@ -196,7 +194,6 @@ abstract class Group : Contact(), CoroutineScope {
@Suppress
(
"FunctionName"
)
@Suppress
(
"FunctionName"
)
@JvmName
(
"quit"
)
@JvmName
(
"quit"
)
@JavaFriendlyAPI
@JavaFriendlyAPI
@SinceMirai
(
"0.39.4"
)
fun
__quitBlockingForJava__
():
Boolean
=
runBlocking
{
quit
()
}
fun
__quitBlockingForJava__
():
Boolean
=
runBlocking
{
quit
()
}
}
}
...
@@ -205,7 +202,6 @@ abstract class Group : Contact(), CoroutineScope {
...
@@ -205,7 +202,6 @@ abstract class Group : Contact(), CoroutineScope {
*
*
* @see Group.settings 获取群设置
* @see Group.settings 获取群设置
*/
*/
@SinceMirai
(
"0.30.0"
)
interface
GroupSettings
{
interface
GroupSettings
{
/**
/**
* 入群公告, 没有时为空字符串.
* 入群公告, 没有时为空字符串.
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Member.kt
View file @
84cfe262
...
@@ -19,7 +19,6 @@ import net.mamoe.mirai.message.MessageReceipt
...
@@ -19,7 +19,6 @@ import net.mamoe.mirai.message.MessageReceipt
import
net.mamoe.mirai.message.data.Message
import
net.mamoe.mirai.message.data.Message
import
net.mamoe.mirai.message.data.toMessage
import
net.mamoe.mirai.message.data.toMessage
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.SinceMirai
import
net.mamoe.mirai.utils.WeakRefProperty
import
net.mamoe.mirai.utils.WeakRefProperty
import
kotlin.jvm.JvmSynthetic
import
kotlin.jvm.JvmSynthetic
import
kotlin.time.Duration
import
kotlin.time.Duration
...
@@ -172,26 +171,22 @@ abstract class Member : MemberJavaFriendlyAPI() {
...
@@ -172,26 +171,22 @@ abstract class Member : MemberJavaFriendlyAPI() {
*
*
* @throws IllegalStateException 当此成员不是好友时抛出
* @throws IllegalStateException 当此成员不是好友时抛出
*/
*/
@SinceMirai
(
"0.39.0"
)
fun
Member
.
asFriend
():
Friend
=
this
.
bot
.
getFriendOrNull
(
this
.
id
)
?:
error
(
"$this is not a friend"
)
fun
Member
.
asFriend
():
Friend
=
this
.
bot
.
getFriendOrNull
(
this
.
id
)
?:
error
(
"$this is not a friend"
)
/**
/**
* 得到此成员作为好友的对象, 当此成员不是好友时返回 `null`
* 得到此成员作为好友的对象, 当此成员不是好友时返回 `null`
*/
*/
@SinceMirai
(
"0.39.0"
)
fun
Member
.
asFriendOrNull
():
Friend
?
=
this
.
bot
.
getFriendOrNull
(
this
.
id
)
fun
Member
.
asFriendOrNull
():
Friend
?
=
this
.
bot
.
getFriendOrNull
(
this
.
id
)
/**
/**
* 判断此成员是否为好友
* 判断此成员是否为好友
*/
*/
@SinceMirai
(
"0.39.0"
)
inline
val
Member
.
isFriend
:
Boolean
inline
val
Member
.
isFriend
:
Boolean
get
()
=
this
.
bot
.
friends
.
contains
(
this
.
id
)
get
()
=
this
.
bot
.
friends
.
contains
(
this
.
id
)
/**
/**
* 如果此成员是好友, 则执行 [block] 并返回其返回值. 否则返回 `null`
* 如果此成员是好友, 则执行 [block] 并返回其返回值. 否则返回 `null`
*/
*/
@SinceMirai
(
"0.39.0"
)
inline
fun
<
R
>
Member
.
takeIfIsFriend
(
block
:
(
Friend
)
->
R
):
R
?
{
inline
fun
<
R
>
Member
.
takeIfIsFriend
(
block
:
(
Friend
)
->
R
):
R
?
{
return
this
.
asFriendOrNull
()
?.
let
(
block
)
return
this
.
asFriendOrNull
()
?.
let
(
block
)
}
}
...
@@ -210,7 +205,6 @@ val Member.nameCardOrNick: String get() = this.nameCard.takeIf { it.isNotEmpty()
...
@@ -210,7 +205,6 @@ val Member.nameCardOrNick: String get() = this.nameCard.takeIf { it.isNotEmpty()
*
*
* 否则返回 [Member.nick]
* 否则返回 [Member.nick]
*/
*/
@SinceMirai
(
"0.39.0"
)
val
User
.
nameCardOrNick
:
String
val
User
.
nameCardOrNick
:
String
get
()
=
when
(
this
)
{
get
()
=
when
(
this
)
{
is
Member
->
this
.
nameCardOrNick
is
Member
->
this
.
nameCardOrNick
...
@@ -220,7 +214,6 @@ val User.nameCardOrNick: String
...
@@ -220,7 +214,6 @@ val User.nameCardOrNick: String
/**
/**
* 判断群成员是否处于禁言状态.
* 判断群成员是否处于禁言状态.
*/
*/
@SinceMirai
(
"0.39.0"
)
val
Member
.
isMuted
:
Boolean
val
Member
.
isMuted
:
Boolean
get
()
=
muteTimeRemaining
!=
0
&&
muteTimeRemaining
!=
0
xFFFFFFFF
.
toInt
()
get
()
=
muteTimeRemaining
!=
0
&&
muteTimeRemaining
!=
0
xFFFFFFFF
.
toInt
()
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/MemberPermission.kt
View file @
84cfe262
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
package
net.mamoe.mirai.contact
package
net.mamoe.mirai.contact
import
net.mamoe.mirai.Bot
import
net.mamoe.mirai.Bot
import
net.mamoe.mirai.utils.SinceMirai
import
kotlin.internal.InlineOnly
import
kotlin.internal.InlineOnly
/**
/**
...
@@ -46,7 +45,6 @@ enum class MemberPermission : Comparable<MemberPermission> {
...
@@ -46,7 +45,6 @@ enum class MemberPermission : Comparable<MemberPermission> {
/**
/**
* 权限等级. [OWNER] 为 2, [ADMINISTRATOR] 为 1, [MEMBER] 为 0
* 权限等级. [OWNER] 为 2, [ADMINISTRATOR] 为 1, [MEMBER] 为 0
*/
*/
@SinceMirai
(
"0.32.0"
)
val
level
:
Int
val
level
:
Int
get
()
=
ordinal
get
()
=
ordinal
}
}
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/data/GroupActiveData.kt
View file @
84cfe262
...
@@ -4,14 +4,12 @@ package net.mamoe.mirai.data
...
@@ -4,14 +4,12 @@ package net.mamoe.mirai.data
import
kotlinx.serialization.SerialName
import
kotlinx.serialization.SerialName
import
kotlinx.serialization.Serializable
import
kotlinx.serialization.Serializable
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.SinceMirai
/**
/**
* 群统计信息
* 群统计信息
*/
*/
@MiraiExperimentalAPI
@MiraiExperimentalAPI
@SinceMirai
(
"0.28.0"
)
@Serializable
@Serializable
data class
GroupActiveData
(
data class
GroupActiveData
(
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt
View file @
84cfe262
...
@@ -28,7 +28,6 @@ import net.mamoe.mirai.qqandroid.network.Packet
...
@@ -28,7 +28,6 @@ import net.mamoe.mirai.qqandroid.network.Packet
import
net.mamoe.mirai.utils.ExternalImage
import
net.mamoe.mirai.utils.ExternalImage
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.SinceMirai
import
net.mamoe.mirai.utils.internal.runBlocking
import
net.mamoe.mirai.utils.internal.runBlocking
import
kotlin.jvm.JvmField
import
kotlin.jvm.JvmField
import
kotlin.jvm.JvmName
import
kotlin.jvm.JvmName
...
@@ -78,7 +77,6 @@ sealed class BotOfflineEvent : BotEvent, AbstractEvent() {
...
@@ -78,7 +77,6 @@ sealed class BotOfflineEvent : BotEvent, AbstractEvent() {
/**
/**
* 服务器主动要求更换另一个服务器
* 服务器主动要求更换另一个服务器
*/
*/
@SinceMirai
(
"0.37.1"
)
data class
RequireReconnect
(
override
val
bot
:
Bot
)
:
BotOfflineEvent
(),
Packet
,
BotPassiveEvent
data class
RequireReconnect
(
override
val
bot
:
Bot
)
:
BotOfflineEvent
(),
Packet
,
BotPassiveEvent
}
}
...
@@ -134,7 +132,6 @@ sealed class MessageRecallEvent : BotEvent, AbstractEvent() {
...
@@ -134,7 +132,6 @@ sealed class MessageRecallEvent : BotEvent, AbstractEvent() {
* 消息内部 id.
* 消息内部 id.
* @see MessageSource.id
* @see MessageSource.id
*/
*/
@SinceMirai
(
"0.39.0"
)
abstract
val
messageInternalId
:
Int
abstract
val
messageInternalId
:
Int
/**
/**
...
@@ -238,20 +235,17 @@ sealed class ImageUploadEvent : BotEvent, BotActiveEvent, AbstractEvent() {
...
@@ -238,20 +235,17 @@ sealed class ImageUploadEvent : BotEvent, BotActiveEvent, AbstractEvent() {
/**
/**
* 机器人被踢出群或在其他客户端主动退出一个群. 在事件广播前 [Bot.groups] 就已删除这个群.
* 机器人被踢出群或在其他客户端主动退出一个群. 在事件广播前 [Bot.groups] 就已删除这个群.
*/
*/
@SinceMirai
(
"0.36.0"
)
sealed
class
BotLeaveEvent
:
BotEvent
,
Packet
,
AbstractEvent
()
{
sealed
class
BotLeaveEvent
:
BotEvent
,
Packet
,
AbstractEvent
()
{
abstract
val
group
:
Group
abstract
val
group
:
Group
/**
/**
* 机器人主动退出一个群.
* 机器人主动退出一个群.
*/
*/
@SinceMirai
(
"0.37.0"
)
data class
Active
(
override
val
group
:
Group
)
:
BotLeaveEvent
()
data class
Active
(
override
val
group
:
Group
)
:
BotLeaveEvent
()
/**
/**
* 机器人被管理员或群主踢出群. 暂不支持获取操作人
* 机器人被管理员或群主踢出群. 暂不支持获取操作人
*/
*/
@SinceMirai
(
"0.37.0"
)
data class
Kick
(
override
val
group
:
Group
)
:
BotLeaveEvent
()
data class
Kick
(
override
val
group
:
Group
)
:
BotLeaveEvent
()
override
val
bot
:
Bot
get
()
=
group
.
bot
override
val
bot
:
Bot
get
()
=
group
.
bot
...
@@ -324,7 +318,6 @@ data class GroupNameChangeEvent(
...
@@ -324,7 +318,6 @@ data class GroupNameChangeEvent(
/**
/**
* 操作人. 为 null 时则是机器人操作
* 操作人. 为 null 时则是机器人操作
*/
*/
@SinceMirai
(
"0.37.3"
)
override
val
operator
:
Member
?
override
val
operator
:
Member
?
)
:
GroupSettingChangeEvent
<
String
>,
Packet
,
GroupOperableEvent
,
AbstractEvent
()
{
)
:
GroupSettingChangeEvent
<
String
>,
Packet
,
GroupOperableEvent
,
AbstractEvent
()
{
@Deprecated
(
"for binary compatibility"
,
level
=
DeprecationLevel
.
HIDDEN
)
@Deprecated
(
"for binary compatibility"
,
level
=
DeprecationLevel
.
HIDDEN
)
...
@@ -412,13 +405,11 @@ sealed class MemberJoinEvent(override val member: Member) : GroupMemberEvent, Bo
...
@@ -412,13 +405,11 @@ sealed class MemberJoinEvent(override val member: Member) : GroupMemberEvent, Bo
/**
/**
* 被邀请加入群
* 被邀请加入群
*/
*/
@SinceMirai
(
"0.36.0"
)
data class
Invite
(
override
val
member
:
Member
)
:
MemberJoinEvent
(
member
)
data class
Invite
(
override
val
member
:
Member
)
:
MemberJoinEvent
(
member
)
/**
/**
* 成员主动加入群
* 成员主动加入群
*/
*/
@SinceMirai
(
"0.36.0"
)
data class
Active
(
override
val
member
:
Member
)
:
MemberJoinEvent
(
member
)
data class
Active
(
override
val
member
:
Member
)
:
MemberJoinEvent
(
member
)
}
}
...
@@ -454,7 +445,6 @@ sealed class MemberLeaveEvent : GroupMemberEvent, AbstractEvent() {
...
@@ -454,7 +445,6 @@ sealed class MemberLeaveEvent : GroupMemberEvent, AbstractEvent() {
/**
/**
* [Bot] 被邀请加入一个群.
* [Bot] 被邀请加入一个群.
*/
*/
@SinceMirai
(
"0.39.4"
)
data class
BotInvitedJoinGroupRequestEvent
(
data class
BotInvitedJoinGroupRequestEvent
(
override
val
bot
:
Bot
,
override
val
bot
:
Bot
,
/**
/**
...
@@ -497,7 +487,6 @@ data class BotInvitedJoinGroupRequestEvent(
...
@@ -497,7 +487,6 @@ data class BotInvitedJoinGroupRequestEvent(
/**
/**
* 一个账号请求加入群事件, [Bot] 在此群中是管理员或群主.
* 一个账号请求加入群事件, [Bot] 在此群中是管理员或群主.
*/
*/
@SinceMirai
(
"0.35.0"
)
data class
MemberJoinRequestEvent
(
data class
MemberJoinRequestEvent
(
override
val
bot
:
Bot
,
override
val
bot
:
Bot
,
/**
/**
...
@@ -653,7 +642,6 @@ data class MemberUnmuteEvent(
...
@@ -653,7 +642,6 @@ data class MemberUnmuteEvent(
/**
/**
* 好友昵称改变事件. 目前仅支持解析 (来自 PC 端的修改).
* 好友昵称改变事件. 目前仅支持解析 (来自 PC 端的修改).
*/
*/
@SinceMirai
(
"0.36.0"
)
data class
FriendRemarkChangeEvent
(
data class
FriendRemarkChangeEvent
(
override
val
bot
:
Bot
,
override
val
bot
:
Bot
,
override
val
friend
:
Friend
,
override
val
friend
:
Friend
,
...
@@ -663,7 +651,6 @@ data class FriendRemarkChangeEvent(
...
@@ -663,7 +651,6 @@ data class FriendRemarkChangeEvent(
/**
/**
* 成功添加了一个新好友的事件
* 成功添加了一个新好友的事件
*/
*/
@SinceMirai
(
"0.36.0"
)
data class
FriendAddEvent
(
data class
FriendAddEvent
(
/**
/**
* 新好友. 已经添加到 [Bot.friends]
* 新好友. 已经添加到 [Bot.friends]
...
@@ -676,7 +663,6 @@ data class FriendAddEvent(
...
@@ -676,7 +663,6 @@ data class FriendAddEvent(
/**
/**
* 好友已被删除的事件.
* 好友已被删除的事件.
*/
*/
@SinceMirai
(
"0.36.0"
)
data class
FriendDeleteEvent
(
data class
FriendDeleteEvent
(
override
val
friend
:
Friend
override
val
friend
:
Friend
)
:
FriendEvent
,
Packet
,
AbstractEvent
()
{
)
:
FriendEvent
,
Packet
,
AbstractEvent
()
{
...
@@ -686,7 +672,6 @@ data class FriendDeleteEvent(
...
@@ -686,7 +672,6 @@ data class FriendDeleteEvent(
/**
/**
* 一个账号请求添加机器人为好友的事件
* 一个账号请求添加机器人为好友的事件
*/
*/
@SinceMirai
(
"0.35.0"
)
data class
NewFriendRequestEvent
(
data class
NewFriendRequestEvent
(
override
val
bot
:
Bot
,
override
val
bot
:
Bot
,
/**
/**
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/linear.kt
View file @
84cfe262
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
package
net.mamoe.mirai.event
package
net.mamoe.mirai.event
import
kotlinx.coroutines.*
import
kotlinx.coroutines.*
import
net.mamoe.mirai.utils.SinceMirai
import
kotlin.coroutines.CoroutineContext
import
kotlin.coroutines.CoroutineContext
import
kotlin.coroutines.EmptyCoroutineContext
import
kotlin.coroutines.EmptyCoroutineContext
import
kotlin.jvm.JvmSynthetic
import
kotlin.jvm.JvmSynthetic
...
@@ -30,7 +29,6 @@ import kotlin.reflect.KClass
...
@@ -30,7 +29,6 @@ import kotlin.reflect.KClass
* @throws Throwable 当 [mapper] 抛出任何异常时, 本函数会抛出该异常
* @throws Throwable 当 [mapper] 抛出任何异常时, 本函数会抛出该异常
*/
*/
@JvmSynthetic
@JvmSynthetic
@SinceMirai
(
"0.39.0"
)
suspend
inline
fun
<
reified
E
:
Event
,
R
:
Any
>
syncFromEvent
(
suspend
inline
fun
<
reified
E
:
Event
,
R
:
Any
>
syncFromEvent
(
timeoutMillis
:
Long
=
-
1
,
timeoutMillis
:
Long
=
-
1
,
crossinline
mapper
:
suspend
E
.(
E
)
->
R
?
crossinline
mapper
:
suspend
E
.(
E
)
->
R
?
...
@@ -60,7 +58,6 @@ suspend inline fun <reified E : Event, R : Any> syncFromEvent(
...
@@ -60,7 +58,6 @@ suspend inline fun <reified E : Event, R : Any> syncFromEvent(
* @throws Throwable 当 [mapper] 抛出任何异常时, 本函数会抛出该异常
* @throws Throwable 当 [mapper] 抛出任何异常时, 本函数会抛出该异常
*/
*/
@JvmSynthetic
@JvmSynthetic
@SinceMirai
(
"0.39.0"
)
suspend
inline
fun
<
reified
E
:
Event
,
R
:
Any
>
syncFromEventOrNull
(
suspend
inline
fun
<
reified
E
:
Event
,
R
:
Any
>
syncFromEventOrNull
(
timeoutMillis
:
Long
,
timeoutMillis
:
Long
,
crossinline
mapper
:
suspend
E
.(
E
)
->
R
?
crossinline
mapper
:
suspend
E
.(
E
)
->
R
?
...
@@ -83,7 +80,6 @@ suspend inline fun <reified E : Event, R : Any> syncFromEventOrNull(
...
@@ -83,7 +80,6 @@ suspend inline fun <reified E : Event, R : Any> syncFromEventOrNull(
*/
*/
@JvmSynthetic
@JvmSynthetic
@Suppress
(
"DeferredIsResult"
)
@Suppress
(
"DeferredIsResult"
)
@SinceMirai
(
"0.39.0"
)
inline
fun
<
reified
E
:
Event
,
R
:
Any
>
CoroutineScope
.
asyncFromEventOrNull
(
inline
fun
<
reified
E
:
Event
,
R
:
Any
>
CoroutineScope
.
asyncFromEventOrNull
(
timeoutMillis
:
Long
,
timeoutMillis
:
Long
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
...
@@ -107,7 +103,6 @@ inline fun <reified E : Event, R : Any> CoroutineScope.asyncFromEventOrNull(
...
@@ -107,7 +103,6 @@ inline fun <reified E : Event, R : Any> CoroutineScope.asyncFromEventOrNull(
*/
*/
@JvmSynthetic
@JvmSynthetic
@Suppress
(
"DeferredIsResult"
)
@Suppress
(
"DeferredIsResult"
)
@SinceMirai
(
"0.39.0"
)
inline
fun
<
reified
E
:
Event
,
R
:
Any
>
CoroutineScope
.
asyncFromEvent
(
inline
fun
<
reified
E
:
Event
,
R
:
Any
>
CoroutineScope
.
asyncFromEvent
(
timeoutMillis
:
Long
=
-
1
,
timeoutMillis
:
Long
=
-
1
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/select.kt
View file @
84cfe262
...
@@ -18,7 +18,6 @@ import net.mamoe.mirai.message.data.PlainText
...
@@ -18,7 +18,6 @@ import net.mamoe.mirai.message.data.PlainText
import
net.mamoe.mirai.message.isContextIdenticalWith
import
net.mamoe.mirai.message.isContextIdenticalWith
import
net.mamoe.mirai.message.nextMessage
import
net.mamoe.mirai.message.nextMessage
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.SinceMirai
import
kotlin.experimental.ExperimentalTypeInference
import
kotlin.experimental.ExperimentalTypeInference
import
kotlin.jvm.JvmName
import
kotlin.jvm.JvmName
import
kotlin.jvm.JvmSynthetic
import
kotlin.jvm.JvmSynthetic
...
@@ -59,7 +58,6 @@ import kotlin.jvm.JvmSynthetic
...
@@ -59,7 +58,6 @@ import kotlin.jvm.JvmSynthetic
* @see subscribeMessages
* @see subscribeMessages
* @see nextMessage 挂起协程并等待下一条消息
* @see nextMessage 挂起协程并等待下一条消息
*/
*/
@SinceMirai
(
"0.29.0"
)
@Suppress
(
"unused"
)
@Suppress
(
"unused"
)
suspend
inline
fun
<
reified
T
:
MessageEvent
>
T
.
whileSelectMessages
(
suspend
inline
fun
<
reified
T
:
MessageEvent
>
T
.
whileSelectMessages
(
timeoutMillis
:
Long
=
-
1
,
timeoutMillis
:
Long
=
-
1
,
...
@@ -72,7 +70,6 @@ suspend inline fun <reified T : MessageEvent> T.whileSelectMessages(
...
@@ -72,7 +70,6 @@ suspend inline fun <reified T : MessageEvent> T.whileSelectMessages(
*/
*/
@OptIn
(
ExperimentalTypeInference
::
class
)
@OptIn
(
ExperimentalTypeInference
::
class
)
@MiraiExperimentalAPI
@MiraiExperimentalAPI
@SinceMirai
(
"0.29.0"
)
@JvmName
(
"selectMessages1"
)
@JvmName
(
"selectMessages1"
)
suspend
inline
fun
<
reified
T
:
MessageEvent
>
T
.
selectMessagesUnit
(
suspend
inline
fun
<
reified
T
:
MessageEvent
>
T
.
selectMessagesUnit
(
timeoutMillis
:
Long
=
-
1
,
timeoutMillis
:
Long
=
-
1
,
...
@@ -101,7 +98,6 @@ suspend inline fun <reified T : MessageEvent> T.selectMessagesUnit(
...
@@ -101,7 +98,6 @@ suspend inline fun <reified T : MessageEvent> T.selectMessagesUnit(
*
*
* @see nextMessage 挂起协程并等待下一条消息
* @see nextMessage 挂起协程并等待下一条消息
*/
*/
@SinceMirai
(
"0.29.0"
)
@Suppress
(
"unused"
)
// false positive
@Suppress
(
"unused"
)
// false positive
// @BuilderInference // https://youtrack.jetbrains.com/issue/KT-37716
// @BuilderInference // https://youtrack.jetbrains.com/issue/KT-37716
suspend
inline
fun
<
reified
T
:
MessageEvent
,
R
>
T
.
selectMessages
(
suspend
inline
fun
<
reified
T
:
MessageEvent
,
R
>
T
.
selectMessages
(
...
@@ -120,7 +116,6 @@ suspend inline fun <reified T : MessageEvent, R> T.selectMessages(
...
@@ -120,7 +116,6 @@ suspend inline fun <reified T : MessageEvent, R> T.selectMessages(
* @see MessageSelectBuilderUnit 查看上层 API
* @see MessageSelectBuilderUnit 查看上层 API
*/
*/
@Suppress
(
"PARAMETER_NAME_CHANGED_ON_OVERRIDE"
)
@Suppress
(
"PARAMETER_NAME_CHANGED_ON_OVERRIDE"
)
@SinceMirai
(
"0.29.0"
)
abstract
class
MessageSelectBuilder
<
M
:
MessageEvent
,
R
>
@PublishedApi
internal
constructor
(
abstract
class
MessageSelectBuilder
<
M
:
MessageEvent
,
R
>
@PublishedApi
internal
constructor
(
ownerMessagePacket
:
M
,
ownerMessagePacket
:
M
,
stub
:
Any
?,
stub
:
Any
?,
...
@@ -235,7 +230,6 @@ abstract class MessageSelectBuilder<M : MessageEvent, R> @PublishedApi internal
...
@@ -235,7 +230,6 @@ abstract class MessageSelectBuilder<M : MessageEvent, R> @PublishedApi internal
*
*
* @see MessageSubscribersBuilder 查看上层 API
* @see MessageSubscribersBuilder 查看上层 API
*/
*/
@SinceMirai
(
"0.29.0"
)
abstract
class
MessageSelectBuilderUnit
<
M
:
MessageEvent
,
R
>
@PublishedApi
internal
constructor
(
abstract
class
MessageSelectBuilderUnit
<
M
:
MessageEvent
,
R
>
@PublishedApi
internal
constructor
(
private
val
ownerMessagePacket
:
M
,
private
val
ownerMessagePacket
:
M
,
stub
:
Any
?,
stub
:
Any
?,
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/subscribeMessages.kt
View file @
84cfe262
...
@@ -21,7 +21,6 @@ import net.mamoe.mirai.message.FriendMessageEvent
...
@@ -21,7 +21,6 @@ import net.mamoe.mirai.message.FriendMessageEvent
import
net.mamoe.mirai.message.GroupMessageEvent
import
net.mamoe.mirai.message.GroupMessageEvent
import
net.mamoe.mirai.message.MessageEvent
import
net.mamoe.mirai.message.MessageEvent
import
net.mamoe.mirai.message.TempMessageEvent
import
net.mamoe.mirai.message.TempMessageEvent
import
net.mamoe.mirai.utils.SinceMirai
import
kotlin.contracts.ExperimentalContracts
import
kotlin.contracts.ExperimentalContracts
import
kotlin.contracts.InvocationKind
import
kotlin.contracts.InvocationKind
import
kotlin.contracts.contract
import
kotlin.contracts.contract
...
@@ -211,7 +210,6 @@ fun <R> Bot.subscribeFriendMessages(
...
@@ -211,7 +210,6 @@ fun <R> Bot.subscribeFriendMessages(
*
*
* @see CoroutineScope.incoming 打开一个指定事件的接收通道
* @see CoroutineScope.incoming 打开一个指定事件的接收通道
*/
*/
@SinceMirai
(
"0.35.0"
)
@OptIn
(
ExperimentalContracts
::
class
)
@OptIn
(
ExperimentalContracts
::
class
)
fun
<
R
>
Bot
.
subscribeTempMessages
(
fun
<
R
>
Bot
.
subscribeTempMessages
(
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/subscriber.kt
View file @
84cfe262
...
@@ -206,7 +206,6 @@ inline fun <reified E : Event> CoroutineScope.subscribe(
...
@@ -206,7 +206,6 @@ inline fun <reified E : Event> CoroutineScope.subscribe(
*
*
* @see CoroutineScope.subscribe
* @see CoroutineScope.subscribe
*/
*/
@SinceMirai
(
"0.38.0"
)
fun
<
E
:
Event
>
CoroutineScope
.
subscribe
(
fun
<
E
:
Event
>
CoroutineScope
.
subscribe
(
eventClass
:
KClass
<
E
>,
eventClass
:
KClass
<
E
>,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
...
@@ -238,7 +237,6 @@ inline fun <reified E : Event> CoroutineScope.subscribeAlways(
...
@@ -238,7 +237,6 @@ inline fun <reified E : Event> CoroutineScope.subscribeAlways(
/**
/**
* @see CoroutineScope.subscribeAlways
* @see CoroutineScope.subscribeAlways
*/
*/
@SinceMirai
(
"0.38.0"
)
fun
<
E
:
Event
>
CoroutineScope
.
subscribeAlways
(
fun
<
E
:
Event
>
CoroutineScope
.
subscribeAlways
(
eventClass
:
KClass
<
E
>,
eventClass
:
KClass
<
E
>,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
...
@@ -271,7 +269,6 @@ inline fun <reified E : Event> CoroutineScope.subscribeOnce(
...
@@ -271,7 +269,6 @@ inline fun <reified E : Event> CoroutineScope.subscribeOnce(
/**
/**
* @see CoroutineScope.subscribeOnce
* @see CoroutineScope.subscribeOnce
*/
*/
@SinceMirai
(
"0.38.0"
)
fun
<
E
:
Event
>
CoroutineScope
.
subscribeOnce
(
fun
<
E
:
Event
>
CoroutineScope
.
subscribeOnce
(
eventClass
:
KClass
<
E
>,
eventClass
:
KClass
<
E
>,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
...
@@ -308,7 +305,6 @@ inline fun <reified E : BotEvent> Bot.subscribe(
...
@@ -308,7 +305,6 @@ inline fun <reified E : BotEvent> Bot.subscribe(
*
*
* @see Bot.subscribe
* @see Bot.subscribe
*/
*/
@SinceMirai
(
"0.38.0"
)
fun
<
E
:
BotEvent
>
Bot
.
subscribe
(
fun
<
E
:
BotEvent
>
Bot
.
subscribe
(
eventClass
:
KClass
<
E
>,
eventClass
:
KClass
<
E
>,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
...
@@ -345,7 +341,6 @@ inline fun <reified E : BotEvent> Bot.subscribeAlways(
...
@@ -345,7 +341,6 @@ inline fun <reified E : BotEvent> Bot.subscribeAlways(
*
*
* @see Bot.subscribeAlways
* @see Bot.subscribeAlways
*/
*/
@SinceMirai
(
"0.38.0"
)
fun
<
E
:
BotEvent
>
Bot
.
subscribeAlways
(
fun
<
E
:
BotEvent
>
Bot
.
subscribeAlways
(
eventClass
:
KClass
<
E
>,
eventClass
:
KClass
<
E
>,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
...
@@ -376,7 +371,6 @@ inline fun <reified E : BotEvent> Bot.subscribeOnce(
...
@@ -376,7 +371,6 @@ inline fun <reified E : BotEvent> Bot.subscribeOnce(
*
*
* @see Bot.subscribeOnce
* @see Bot.subscribeOnce
*/
*/
@SinceMirai
(
"0.38.0"
)
fun
<
E
:
BotEvent
>
Bot
.
subscribeOnce
(
fun
<
E
:
BotEvent
>
Bot
.
subscribeOnce
(
eventClass
:
KClass
<
E
>,
eventClass
:
KClass
<
E
>,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
coroutineContext
:
CoroutineContext
=
EmptyCoroutineContext
,
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/lowLevelApi.kt
View file @
84cfe262
...
@@ -14,7 +14,6 @@ import net.mamoe.mirai.contact.Friend
...
@@ -14,7 +14,6 @@ import net.mamoe.mirai.contact.Friend
import
net.mamoe.mirai.contact.Group
import
net.mamoe.mirai.contact.Group
import
net.mamoe.mirai.data.*
import
net.mamoe.mirai.data.*
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.SinceMirai
import
net.mamoe.mirai.utils.WeakRef
import
net.mamoe.mirai.utils.WeakRef
/**
/**
...
@@ -73,7 +72,6 @@ interface LowLevelBotAPIAccessor {
...
@@ -73,7 +72,6 @@ interface LowLevelBotAPIAccessor {
* 获取群公告列表
* 获取群公告列表
* @param page 页码
* @param page 页码
*/
*/
@SinceMirai
(
"0.28.0"
)
@LowLevelAPI
@LowLevelAPI
@MiraiExperimentalAPI
@MiraiExperimentalAPI
suspend
fun
_lowLevelGetAnnouncements
(
groupId
:
Long
,
page
:
Int
=
1
,
amount
:
Int
=
10
):
GroupAnnouncementList
suspend
fun
_lowLevelGetAnnouncements
(
groupId
:
Long
,
page
:
Int
=
1
,
amount
:
Int
=
10
):
GroupAnnouncementList
...
@@ -83,7 +81,6 @@ interface LowLevelBotAPIAccessor {
...
@@ -83,7 +81,6 @@ interface LowLevelBotAPIAccessor {
*
*
* @return 公告的fid
* @return 公告的fid
*/
*/
@SinceMirai
(
"0.28.0"
)
@LowLevelAPI
@LowLevelAPI
@MiraiExperimentalAPI
@MiraiExperimentalAPI
suspend
fun
_lowLevelSendAnnouncement
(
groupId
:
Long
,
announcement
:
GroupAnnouncement
):
String
suspend
fun
_lowLevelSendAnnouncement
(
groupId
:
Long
,
announcement
:
GroupAnnouncement
):
String
...
@@ -93,7 +90,6 @@ interface LowLevelBotAPIAccessor {
...
@@ -93,7 +90,6 @@ interface LowLevelBotAPIAccessor {
* 删除群公告
* 删除群公告
* @param fid [GroupAnnouncement.fid]
* @param fid [GroupAnnouncement.fid]
*/
*/
@SinceMirai
(
"0.28.0"
)
@LowLevelAPI
@LowLevelAPI
@MiraiExperimentalAPI
@MiraiExperimentalAPI
suspend
fun
_lowLevelDeleteAnnouncement
(
groupId
:
Long
,
fid
:
String
)
suspend
fun
_lowLevelDeleteAnnouncement
(
groupId
:
Long
,
fid
:
String
)
...
@@ -102,7 +98,6 @@ interface LowLevelBotAPIAccessor {
...
@@ -102,7 +98,6 @@ interface LowLevelBotAPIAccessor {
* 获取一条群公告
* 获取一条群公告
* @param fid [GroupAnnouncement.fid]
* @param fid [GroupAnnouncement.fid]
*/
*/
@SinceMirai
(
"0.28.0"
)
@LowLevelAPI
@LowLevelAPI
@MiraiExperimentalAPI
@MiraiExperimentalAPI
suspend
fun
_lowLevelGetAnnouncement
(
groupId
:
Long
,
fid
:
String
):
GroupAnnouncement
suspend
fun
_lowLevelGetAnnouncement
(
groupId
:
Long
,
fid
:
String
):
GroupAnnouncement
...
@@ -111,7 +106,6 @@ interface LowLevelBotAPIAccessor {
...
@@ -111,7 +106,6 @@ interface LowLevelBotAPIAccessor {
/**
/**
* 获取群活跃信息
* 获取群活跃信息
*/
*/
@SinceMirai
(
"0.29.0"
)
@LowLevelAPI
@LowLevelAPI
@MiraiExperimentalAPI
@MiraiExperimentalAPI
suspend
fun
_lowLevelGetGroupActiveData
(
groupId
:
Long
):
GroupActiveData
suspend
fun
_lowLevelGetGroupActiveData
(
groupId
:
Long
):
GroupActiveData
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/MessageEvent.kt
View file @
84cfe262
...
@@ -44,7 +44,6 @@ import kotlin.jvm.JvmSynthetic
...
@@ -44,7 +44,6 @@ import kotlin.jvm.JvmSynthetic
* @see isContextIdenticalWith 判断语境是否相同
* @see isContextIdenticalWith 判断语境是否相同
*/
*/
@Suppress
(
"DEPRECATION_ERROR"
)
@Suppress
(
"DEPRECATION_ERROR"
)
@SinceMirai
(
"0.32.0"
)
abstract
class
MessageEvent
:
@PlannedRemoval
(
"1.2.0"
)
ContactMessage
(),
abstract
class
MessageEvent
:
@PlannedRemoval
(
"1.2.0"
)
ContactMessage
(),
BotEvent
,
MessageEventExtensions
<
User
,
Contact
>
{
BotEvent
,
MessageEventExtensions
<
User
,
Contact
>
{
...
@@ -77,7 +76,6 @@ abstract class MessageEvent : @PlannedRemoval("1.2.0") ContactMessage(),
...
@@ -77,7 +76,6 @@ abstract class MessageEvent : @PlannedRemoval("1.2.0") ContactMessage(),
abstract
override
val
message
:
MessageChain
abstract
override
val
message
:
MessageChain
/** 消息发送时间 (由服务器提供) */
/** 消息发送时间 (由服务器提供) */
@SinceMirai
(
"0.39.0"
)
abstract
val
time
:
Int
abstract
val
time
:
Int
/** 消息源 */
/** 消息源 */
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/TempMessageEvent.kt
View file @
84cfe262
...
@@ -11,14 +11,12 @@ import net.mamoe.mirai.message.data.MessageChain
...
@@ -11,14 +11,12 @@ import net.mamoe.mirai.message.data.MessageChain
import
net.mamoe.mirai.message.data.MessageSource
import
net.mamoe.mirai.message.data.MessageSource
import
net.mamoe.mirai.message.data.OnlineMessageSource
import
net.mamoe.mirai.message.data.OnlineMessageSource
import
net.mamoe.mirai.message.data.source
import
net.mamoe.mirai.message.data.source
import
net.mamoe.mirai.utils.SinceMirai
/**
/**
* 机器人收到的群临时会话消息的事件
* 机器人收到的群临时会话消息的事件
*
*
* @see MessageEvent
* @see MessageEvent
*/
*/
@SinceMirai
(
"0.35.0"
)
class
TempMessageEvent
(
class
TempMessageEvent
(
override
val
sender
:
Member
,
override
val
sender
:
Member
,
override
val
message
:
MessageChain
,
override
val
message
:
MessageChain
,
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/AtAll.kt
View file @
84cfe262
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
package
net.mamoe.mirai.message.data
package
net.mamoe.mirai.message.data
import
net.mamoe.mirai.utils.SinceMirai
import
kotlin.jvm.JvmMultifileClass
import
kotlin.jvm.JvmMultifileClass
import
kotlin.jvm.JvmName
import
kotlin.jvm.JvmName
...
@@ -28,8 +27,6 @@ private const val displayA = "@全体成员"
...
@@ -28,8 +27,6 @@ private const val displayA = "@全体成员"
object
AtAll
:
object
AtAll
:
Message
.
Key
<
AtAll
>,
Message
.
Key
<
AtAll
>,
MessageContent
{
MessageContent
{
@SinceMirai
(
"0.31.2"
)
const
val
display
=
displayA
const
val
display
=
displayA
override
val
typeName
:
String
override
val
typeName
:
String
get
()
=
"AtAll"
get
()
=
"AtAll"
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/CustomMessage.kt
View file @
84cfe262
...
@@ -33,7 +33,6 @@ import net.mamoe.mirai.utils.*
...
@@ -33,7 +33,6 @@ import net.mamoe.mirai.utils.*
*
*
* @see CustomMessageMetadata 自定义消息元数据
* @see CustomMessageMetadata 自定义消息元数据
*/
*/
@SinceMirai
(
"0.38.0"
)
@MiraiExperimentalAPI
@MiraiExperimentalAPI
sealed
class
CustomMessage
:
SingleMessage
{
sealed
class
CustomMessage
:
SingleMessage
{
/**
/**
...
@@ -181,7 +180,6 @@ sealed class CustomMessage : SingleMessage {
...
@@ -181,7 +180,6 @@ sealed class CustomMessage : SingleMessage {
* @see CustomMessage 查看更多信息
* @see CustomMessage 查看更多信息
* @see ConstrainSingle 可实现此接口以保证消息链中只存在一个元素
* @see ConstrainSingle 可实现此接口以保证消息链中只存在一个元素
*/
*/
@SinceMirai
(
"0.38.0"
)
@MiraiExperimentalAPI
@MiraiExperimentalAPI
abstract
class
CustomMessageMetadata
:
CustomMessage
(),
MessageMetadata
{
abstract
class
CustomMessageMetadata
:
CustomMessage
(),
MessageMetadata
{
companion
object
Key
:
Message
.
Key
<
CustomMessageMetadata
>
{
companion
object
Key
:
Message
.
Key
<
CustomMessageMetadata
>
{
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/ForwardMessage.kt
View file @
84cfe262
...
@@ -19,7 +19,6 @@ import net.mamoe.mirai.contact.nameCardOrNick
...
@@ -19,7 +19,6 @@ import net.mamoe.mirai.contact.nameCardOrNick
import
net.mamoe.mirai.message.MessageEvent
import
net.mamoe.mirai.message.MessageEvent
import
net.mamoe.mirai.message.data.ForwardMessage.DisplayStrategy
import
net.mamoe.mirai.message.data.ForwardMessage.DisplayStrategy
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.SinceMirai
import
net.mamoe.mirai.utils.currentTimeSeconds
import
net.mamoe.mirai.utils.currentTimeSeconds
import
kotlin.jvm.JvmOverloads
import
kotlin.jvm.JvmOverloads
import
kotlin.jvm.JvmSynthetic
import
kotlin.jvm.JvmSynthetic
...
@@ -79,7 +78,6 @@ import kotlin.jvm.JvmSynthetic
...
@@ -79,7 +78,6 @@ import kotlin.jvm.JvmSynthetic
*
*
* @see buildForwardMessage
* @see buildForwardMessage
*/
*/
@SinceMirai
(
"0.39.0"
)
class
ForwardMessage
@JvmOverloads
constructor
(
class
ForwardMessage
@JvmOverloads
constructor
(
/**
/**
* 消息列表
* 消息列表
...
@@ -187,7 +185,6 @@ class ForwardMessage @JvmOverloads constructor(
...
@@ -187,7 +185,6 @@ class ForwardMessage @JvmOverloads constructor(
/**
/**
* 转换为 [ForwardMessage]
* 转换为 [ForwardMessage]
*/
*/
@SinceMirai
(
"0.39.0"
)
@JvmOverloads
@JvmOverloads
fun
Iterable
<
MessageEvent
>.
toForwardMessage
(
displayStrategy
:
DisplayStrategy
=
DisplayStrategy
):
ForwardMessage
{
fun
Iterable
<
MessageEvent
>.
toForwardMessage
(
displayStrategy
:
DisplayStrategy
=
DisplayStrategy
):
ForwardMessage
{
val
iterator
=
this
.
iterator
()
val
iterator
=
this
.
iterator
()
...
@@ -208,7 +205,6 @@ fun Message.toForwardMessage(
...
@@ -208,7 +205,6 @@ fun Message.toForwardMessage(
/**
/**
* 转换为 [ForwardMessage]
* 转换为 [ForwardMessage]
*/
*/
@SinceMirai
(
"0.39.0"
)
@JvmOverloads
@JvmOverloads
fun
Message
.
toForwardMessage
(
fun
Message
.
toForwardMessage
(
senderId
:
Long
,
senderId
:
Long
,
...
@@ -223,7 +219,6 @@ fun Message.toForwardMessage(
...
@@ -223,7 +219,6 @@ fun Message.toForwardMessage(
* @see ForwardMessageBuilder 查看 DSL 帮助
* @see ForwardMessageBuilder 查看 DSL 帮助
* @see ForwardMessage 查看转发消息说明
* @see ForwardMessage 查看转发消息说明
*/
*/
@SinceMirai
(
"0.39.0"
)
@JvmSynthetic
@JvmSynthetic
inline
fun
buildForwardMessage
(
inline
fun
buildForwardMessage
(
context
:
Contact
,
context
:
Contact
,
...
@@ -237,7 +232,6 @@ inline fun buildForwardMessage(
...
@@ -237,7 +232,6 @@ inline fun buildForwardMessage(
* @see ForwardMessageBuilder 查看 DSL 帮助
* @see ForwardMessageBuilder 查看 DSL 帮助
* @see ForwardMessage 查看转发消息说明
* @see ForwardMessage 查看转发消息说明
*/
*/
@SinceMirai
(
"0.39.0"
)
@JvmSynthetic
@JvmSynthetic
inline
fun
MessageEvent
.
buildForwardMessage
(
inline
fun
MessageEvent
.
buildForwardMessage
(
context
:
Contact
=
this
.
subject
,
context
:
Contact
=
this
.
subject
,
...
@@ -250,7 +244,6 @@ inline fun MessageEvent.buildForwardMessage(
...
@@ -250,7 +244,6 @@ inline fun MessageEvent.buildForwardMessage(
/**
/**
* 标记转发消息 DSL
* 标记转发消息 DSL
*/
*/
@SinceMirai
(
"0.39.0"
)
@Target
(
AnnotationTarget
.
FUNCTION
,
AnnotationTarget
.
TYPE
)
@Target
(
AnnotationTarget
.
FUNCTION
,
AnnotationTarget
.
TYPE
)
@DslMarker
@DslMarker
annotation
class
ForwardMessageDsl
annotation
class
ForwardMessageDsl
...
@@ -314,7 +307,6 @@ annotation class ForwardMessageDsl
...
@@ -314,7 +307,6 @@ annotation class ForwardMessageDsl
*
*
* `S named "name1" named "name2" says M` 最终的发送人名称为 `"name2"`
* `S named "name1" named "name2" says M` 最终的发送人名称为 `"name2"`
*/
*/
@SinceMirai
(
"0.39.0"
)
class
ForwardMessageBuilder
private
constructor
(
class
ForwardMessageBuilder
private
constructor
(
/**
/**
* 消息语境. 可为 [Group] 或 [User]
* 消息语境. 可为 [Group] 或 [User]
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/HummerMessage.kt
View file @
84cfe262
...
@@ -17,7 +17,6 @@ import net.mamoe.mirai.message.data.PokeMessage.Types
...
@@ -17,7 +17,6 @@ import net.mamoe.mirai.message.data.PokeMessage.Types
import
net.mamoe.mirai.message.data.VipFace.Companion
import
net.mamoe.mirai.message.data.VipFace.Companion
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.SinceMirai
import
kotlin.jvm.*
import
kotlin.jvm.*
/**
/**
...
@@ -26,7 +25,6 @@ import kotlin.jvm.*
...
@@ -26,7 +25,6 @@ import kotlin.jvm.*
* @see PokeMessage 戳一戳
* @see PokeMessage 戳一戳
* @see FlashImage 闪照
* @see FlashImage 闪照
*/
*/
@SinceMirai
(
"0.31.0"
)
sealed
class
HummerMessage
:
MessageContent
{
sealed
class
HummerMessage
:
MessageContent
{
companion
object
Key
:
Message
.
Key
<
HummerMessage
>
{
companion
object
Key
:
Message
.
Key
<
HummerMessage
>
{
override
val
typeName
:
String
override
val
typeName
:
String
...
@@ -44,7 +42,6 @@ sealed class HummerMessage : MessageContent {
...
@@ -44,7 +42,6 @@ sealed class HummerMessage : MessageContent {
*
*
* @see Types 使用伴生对象中的常量
* @see Types 使用伴生对象中的常量
*/
*/
@SinceMirai
(
"0.31.0"
)
@OptIn
(
MiraiInternalAPI
::
class
)
@OptIn
(
MiraiInternalAPI
::
class
)
data class
PokeMessage
internal
constructor
(
data class
PokeMessage
internal
constructor
(
/**
/**
...
@@ -158,7 +155,6 @@ data class PokeMessage internal constructor(
...
@@ -158,7 +155,6 @@ data class PokeMessage internal constructor(
*
*
* @see Types 使用伴生对象中的常量
* @see Types 使用伴生对象中的常量
*/
*/
@SinceMirai
(
"0.39.5"
)
@OptIn
(
MiraiInternalAPI
::
class
)
@OptIn
(
MiraiInternalAPI
::
class
)
data class
VipFace
internal
constructor
(
data class
VipFace
internal
constructor
(
/**
/**
...
@@ -241,7 +237,6 @@ data class VipFace internal constructor(
...
@@ -241,7 +237,6 @@ data class VipFace internal constructor(
*
*
* @see Image 查看图片相关信息
* @see Image 查看图片相关信息
*/
*/
@SinceMirai
(
"0.33.0"
)
sealed
class
FlashImage
:
MessageContent
,
HummerMessage
()
{
sealed
class
FlashImage
:
MessageContent
,
HummerMessage
()
{
companion
object
Key
:
Message
.
Key
<
FlashImage
>
{
companion
object
Key
:
Message
.
Key
<
FlashImage
>
{
/**
/**
...
@@ -289,22 +284,17 @@ sealed class FlashImage : MessageContent, HummerMessage() {
...
@@ -289,22 +284,17 @@ sealed class FlashImage : MessageContent, HummerMessage() {
override
fun
toString
():
String
=
stringValue
!!
override
fun
toString
():
String
=
stringValue
!!
override
fun
contentToString
():
String
=
"[闪照]"
override
fun
contentToString
():
String
=
"[闪照]"
}
}
@SinceMirai
(
"0.33.0"
)
inline
fun
Image
.
flash
():
FlashImage
=
FlashImage
(
this
)
inline
fun
Image
.
flash
():
FlashImage
=
FlashImage
(
this
)
@JvmSynthetic
@JvmSynthetic
@SinceMirai
(
"0.33.0"
)
inline
fun
GroupImage
.
flash
():
GroupFlashImage
=
FlashImage
(
this
)
as
GroupFlashImage
inline
fun
GroupImage
.
flash
():
GroupFlashImage
=
FlashImage
(
this
)
as
GroupFlashImage
@JvmSynthetic
@JvmSynthetic
@SinceMirai
(
"0.33.0"
)
inline
fun
FriendImage
.
flash
():
FriendFlashImage
=
FlashImage
(
this
)
as
FriendFlashImage
inline
fun
FriendImage
.
flash
():
FriendFlashImage
=
FlashImage
(
this
)
as
FriendFlashImage
/**
/**
* @see FlashImage.invoke
* @see FlashImage.invoke
*/
*/
@SinceMirai
(
"0.33.0"
)
data class
GroupFlashImage
(
override
val
image
:
GroupImage
)
:
FlashImage
()
{
data class
GroupFlashImage
(
override
val
image
:
GroupImage
)
:
FlashImage
()
{
companion
object
Key
:
Message
.
Key
<
GroupFlashImage
>
{
companion
object
Key
:
Message
.
Key
<
GroupFlashImage
>
{
override
val
typeName
:
String
override
val
typeName
:
String
...
@@ -315,7 +305,6 @@ data class GroupFlashImage(override val image: GroupImage) : FlashImage() {
...
@@ -315,7 +305,6 @@ data class GroupFlashImage(override val image: GroupImage) : FlashImage() {
/**
/**
* @see FlashImage.invoke
* @see FlashImage.invoke
*/
*/
@SinceMirai
(
"0.33.0"
)
data class
FriendFlashImage
(
override
val
image
:
FriendImage
)
:
FlashImage
()
{
data class
FriendFlashImage
(
override
val
image
:
FriendImage
)
:
FlashImage
()
{
companion
object
Key
:
Message
.
Key
<
FriendFlashImage
>
{
companion
object
Key
:
Message
.
Key
<
FriendFlashImage
>
{
override
val
typeName
:
String
override
val
typeName
:
String
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Image.kt
View file @
84cfe262
...
@@ -22,7 +22,6 @@ import net.mamoe.mirai.contact.Group
...
@@ -22,7 +22,6 @@ import net.mamoe.mirai.contact.Group
import
net.mamoe.mirai.utils.ExternalImage
import
net.mamoe.mirai.utils.ExternalImage
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.PlannedRemoval
import
net.mamoe.mirai.utils.PlannedRemoval
import
net.mamoe.mirai.utils.SinceMirai
import
kotlin.js.JsName
import
kotlin.js.JsName
import
kotlin.jvm.JvmMultifileClass
import
kotlin.jvm.JvmMultifileClass
import
kotlin.jvm.JvmName
import
kotlin.jvm.JvmName
...
@@ -114,7 +113,6 @@ sealed class GroupImage : AbstractImage() {
...
@@ -114,7 +113,6 @@ sealed class GroupImage : AbstractImage() {
* 在 Java 使用: `MessageUtils.calculateImageMd5(image)`
* 在 Java 使用: `MessageUtils.calculateImageMd5(image)`
*/
*/
@
get
:
JvmName
(
"calculateImageMd5"
)
@
get
:
JvmName
(
"calculateImageMd5"
)
@SinceMirai
(
"0.39.0"
)
val
Image
.
md5
:
ByteArray
val
Image
.
md5
:
ByteArray
get
()
=
calculateImageMd5ByImageId
(
imageId
)
get
()
=
calculateImageMd5ByImageId
(
imageId
)
...
@@ -139,7 +137,6 @@ sealed class FriendImage : AbstractImage() {
...
@@ -139,7 +137,6 @@ sealed class FriendImage : AbstractImage() {
* `/f8f1ab55-bf8e-4236-b55e-955848d7069f`
* `/f8f1ab55-bf8e-4236-b55e-955848d7069f`
* @see FRIEND_IMAGE_ID_REGEX_2
* @see FRIEND_IMAGE_ID_REGEX_2
*/
*/
@SinceMirai
(
"0.39.2"
)
// Java: MessageUtils.FRIEND_IMAGE_ID_REGEX_1
// Java: MessageUtils.FRIEND_IMAGE_ID_REGEX_1
val
FRIEND_IMAGE_ID_REGEX_1
=
Regex
(
"""/[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}"""
)
val
FRIEND_IMAGE_ID_REGEX_1
=
Regex
(
"""/[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}"""
)
...
@@ -149,7 +146,6 @@ val FRIEND_IMAGE_ID_REGEX_1 = Regex("""/[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a
...
@@ -149,7 +146,6 @@ val FRIEND_IMAGE_ID_REGEX_1 = Regex("""/[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a
* `/000000000-3814297509-BFB7027B9354B8F899A062061D74E206`
* `/000000000-3814297509-BFB7027B9354B8F899A062061D74E206`
* @see FRIEND_IMAGE_ID_REGEX_1
* @see FRIEND_IMAGE_ID_REGEX_1
*/
*/
@SinceMirai
(
"0.39.2"
)
// Java: MessageUtils.FRIEND_IMAGE_ID_REGEX_2
// Java: MessageUtils.FRIEND_IMAGE_ID_REGEX_2
val
FRIEND_IMAGE_ID_REGEX_2
=
Regex
(
"""/[0-9]*-[0-9]*-[0-9a-fA-F]{32}"""
)
val
FRIEND_IMAGE_ID_REGEX_2
=
Regex
(
"""/[0-9]*-[0-9]*-[0-9a-fA-F]{32}"""
)
...
@@ -159,7 +155,6 @@ val FRIEND_IMAGE_ID_REGEX_2 = Regex("""/[0-9]*-[0-9]*-[0-9a-fA-F]{32}""")
...
@@ -159,7 +155,6 @@ val FRIEND_IMAGE_ID_REGEX_2 = Regex("""/[0-9]*-[0-9]*-[0-9a-fA-F]{32}""")
* `{01E9451B-70ED-EAE3-B37C-101F1EEBF5B5}.mirai`
* `{01E9451B-70ED-EAE3-B37C-101F1EEBF5B5}.mirai`
*/
*/
@Suppress
(
"RegExpRedundantEscape"
)
// This is required on Android
@Suppress
(
"RegExpRedundantEscape"
)
// This is required on Android
@SinceMirai
(
"0.39.2"
)
// Java: MessageUtils.GROUP_IMAGE_ID_REGEX
// Java: MessageUtils.GROUP_IMAGE_ID_REGEX
val
GROUP_IMAGE_ID_REGEX
=
Regex
(
"""\{[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\}\.mirai"""
)
val
GROUP_IMAGE_ID_REGEX
=
Regex
(
"""\{[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\}\.mirai"""
)
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Message.kt
View file @
84cfe262
...
@@ -99,7 +99,6 @@ interface Message { // must be interface. Don't consider any changes.
...
@@ -99,7 +99,6 @@ interface Message { // must be interface. Don't consider any changes.
/**
/**
* 此 [Key] 指代的 [Message] 类型名. 一般为 `class.simpleName`, 如 "QuoteReply", "PlainText"
* 此 [Key] 指代的 [Message] 类型名. 一般为 `class.simpleName`, 如 "QuoteReply", "PlainText"
*/
*/
@SinceMirai
(
"0.34.0"
)
val
typeName
:
String
val
typeName
:
String
}
}
...
@@ -122,7 +121,6 @@ interface Message { // must be interface. Don't consider any changes.
...
@@ -122,7 +121,6 @@ interface Message { // must be interface. Don't consider any changes.
*
*
* @see plus `+` 操作符重载
* @see plus `+` 操作符重载
*/
*/
@SinceMirai
(
"0.34.0"
)
@JvmSynthetic
// in java they should use `plus` instead
@JvmSynthetic
// in java they should use `plus` instead
fun
followedBy
(
tail
:
Message
):
MessageChain
=
followedByImpl
(
tail
)
fun
followedBy
(
tail
:
Message
):
MessageChain
=
followedByImpl
(
tail
)
...
@@ -155,7 +153,6 @@ interface Message { // must be interface. Don't consider any changes.
...
@@ -155,7 +153,6 @@ interface Message { // must be interface. Don't consider any changes.
*
*
* @see toString 得到包含 mirai 消息元素代码的, 易读的字符串
* @see toString 得到包含 mirai 消息元素代码的, 易读的字符串
*/
*/
@SinceMirai
(
"0.34.0"
)
fun
contentToString
():
String
fun
contentToString
():
String
...
@@ -168,7 +165,6 @@ interface Message { // must be interface. Don't consider any changes.
...
@@ -168,7 +165,6 @@ interface Message { // must be interface. Don't consider any changes.
*
*
* @sample net.mamoe.mirai.message.data.ContentEqualsTest
* @sample net.mamoe.mirai.message.data.ContentEqualsTest
*/
*/
@SinceMirai
(
"0.38.0"
)
fun
contentEquals
(
another
:
Message
,
ignoreCase
:
Boolean
=
false
):
Boolean
=
contentEqualsImpl
(
another
,
ignoreCase
)
fun
contentEquals
(
another
:
Message
,
ignoreCase
:
Boolean
=
false
):
Boolean
=
contentEqualsImpl
(
another
,
ignoreCase
)
/**
/**
...
@@ -180,7 +176,6 @@ interface Message { // must be interface. Don't consider any changes.
...
@@ -180,7 +176,6 @@ interface Message { // must be interface. Don't consider any changes.
*
*
* @sample net.mamoe.mirai.message.data.ContentEqualsTest
* @sample net.mamoe.mirai.message.data.ContentEqualsTest
*/
*/
@SinceMirai
(
"0.38.0"
)
fun
contentEquals
(
another
:
String
,
ignoreCase
:
Boolean
=
false
):
Boolean
{
fun
contentEquals
(
another
:
String
,
ignoreCase
:
Boolean
=
false
):
Boolean
{
if
(!
this
.
contentToString
().
equals
(
another
,
ignoreCase
=
ignoreCase
))
return
false
if
(!
this
.
contentToString
().
equals
(
another
,
ignoreCase
=
ignoreCase
))
return
false
return
when
(
this
)
{
return
when
(
this
)
{
...
@@ -217,15 +212,12 @@ inline val Message.content: String get() = contentToString()
...
@@ -217,15 +212,12 @@ inline val Message.content: String get() = contentToString()
* - [PlainText] 长度为 0
* - [PlainText] 长度为 0
* - [MessageChain] 所有元素都满足 [isContentEmpty]
* - [MessageChain] 所有元素都满足 [isContentEmpty]
*/
*/
@SinceMirai
(
"0.39.3"
)
fun
Message
.
isContentEmpty
():
Boolean
=
when
(
this
)
{
fun
Message
.
isContentEmpty
():
Boolean
=
when
(
this
)
{
is
MessageMetadata
->
true
is
MessageMetadata
->
true
is
PlainText
->
this
.
content
.
isEmpty
()
is
PlainText
->
this
.
content
.
isEmpty
()
is
MessageChain
->
this
.
all
{
it
.
isContentEmpty
()
}
is
MessageChain
->
this
.
all
{
it
.
isContentEmpty
()
}
else
->
false
else
->
false
}
}
@SinceMirai
(
"0.39.3"
)
inline
fun
Message
.
isContentNotEmpty
():
Boolean
=
!
this
.
isContentEmpty
()
inline
fun
Message
.
isContentNotEmpty
():
Boolean
=
!
this
.
isContentEmpty
()
inline
fun
Message
.
isPlain
():
Boolean
=
this
is
PlainText
inline
fun
Message
.
isPlain
():
Boolean
=
this
is
PlainText
...
@@ -291,7 +283,6 @@ interface MessageMetadata : SingleMessage
...
@@ -291,7 +283,6 @@ interface MessageMetadata : SingleMessage
*
*
* 实现此接口的元素将会在连接时自动处理替换.
* 实现此接口的元素将会在连接时自动处理替换.
*/
*/
@SinceMirai
(
"0.34.0"
)
interface
ConstrainSingle
<
out
M
:
Message
>
:
MessageMetadata
{
interface
ConstrainSingle
<
out
M
:
Message
>
:
MessageMetadata
{
val
key
:
Key
<
M
>
val
key
:
Key
<
M
>
}
}
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt
View file @
84cfe262
...
@@ -17,7 +17,6 @@ package net.mamoe.mirai.message.data
...
@@ -17,7 +17,6 @@ package net.mamoe.mirai.message.data
import
net.mamoe.mirai.JavaFriendlyAPI
import
net.mamoe.mirai.JavaFriendlyAPI
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.SinceMirai
import
kotlin.js.JsName
import
kotlin.js.JsName
import
kotlin.jvm.JvmMultifileClass
import
kotlin.jvm.JvmMultifileClass
import
kotlin.jvm.JvmName
import
kotlin.jvm.JvmName
...
@@ -44,7 +43,6 @@ interface MessageChain : Message, Iterable<SingleMessage> {
...
@@ -44,7 +43,6 @@ interface MessageChain : Message, Iterable<SingleMessage> {
/**
/**
* 元素数量. [EmptyMessageChain] 不参加计数.
* 元素数量. [EmptyMessageChain] 不参加计数.
*/
*/
@SinceMirai
(
"0.31.1"
)
val
size
:
Int
val
size
:
Int
/**
/**
...
@@ -96,7 +94,6 @@ interface MessageChain : Message, Iterable<SingleMessage> {
...
@@ -96,7 +94,6 @@ interface MessageChain : Message, Iterable<SingleMessage> {
/**
/**
* 遍历每一个 [消息内容][MessageContent]
* 遍历每一个 [消息内容][MessageContent]
*/
*/
@SinceMirai
(
"0.39.0"
)
@JvmSynthetic
@JvmSynthetic
inline
fun
MessageChain
.
forEachContent
(
block
:
(
MessageContent
)
->
Unit
)
{
inline
fun
MessageChain
.
forEachContent
(
block
:
(
MessageContent
)
->
Unit
)
{
for
(
element
in
this
)
{
for
(
element
in
this
)
{
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChainBuilder.kt
View file @
84cfe262
...
@@ -14,7 +14,6 @@
...
@@ -14,7 +14,6 @@
package
net.mamoe.mirai.message.data
package
net.mamoe.mirai.message.data
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.SinceMirai
import
kotlin.jvm.JvmMultifileClass
import
kotlin.jvm.JvmMultifileClass
import
kotlin.jvm.JvmName
import
kotlin.jvm.JvmName
import
kotlin.jvm.JvmSynthetic
import
kotlin.jvm.JvmSynthetic
...
@@ -159,7 +158,6 @@ open class MessageChainBuilder private constructor(
...
@@ -159,7 +158,6 @@ open class MessageChainBuilder private constructor(
/**
/**
* 将所有已有元素引用复制到一个新的 [MessageChainBuilder]
* 将所有已有元素引用复制到一个新的 [MessageChainBuilder]
*/
*/
@SinceMirai
(
"0.38.0"
)
fun
copy
():
MessageChainBuilder
{
fun
copy
():
MessageChainBuilder
{
return
MessageChainBuilder
(
container
.
toMutableList
())
return
MessageChainBuilder
(
container
.
toMutableList
())
}
}
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageSource.kt
View file @
84cfe262
...
@@ -22,7 +22,6 @@ import net.mamoe.mirai.recallIn
...
@@ -22,7 +22,6 @@ import net.mamoe.mirai.recallIn
import
net.mamoe.mirai.utils.LazyProperty
import
net.mamoe.mirai.utils.LazyProperty
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.SinceMirai
import
kotlin.coroutines.CoroutineContext
import
kotlin.coroutines.CoroutineContext
import
kotlin.coroutines.EmptyCoroutineContext
import
kotlin.coroutines.EmptyCoroutineContext
import
kotlin.jvm.JvmMultifileClass
import
kotlin.jvm.JvmMultifileClass
...
@@ -60,7 +59,6 @@ import kotlin.jvm.JvmSynthetic
...
@@ -60,7 +59,6 @@ import kotlin.jvm.JvmSynthetic
* @see OfflineMessageSource 离线消息的 [MessageSource]
* @see OfflineMessageSource 离线消息的 [MessageSource]
*/
*/
@OptIn
(
MiraiExperimentalAPI
::
class
)
@OptIn
(
MiraiExperimentalAPI
::
class
)
@SinceMirai
(
"0.33.0"
)
sealed
class
MessageSource
:
Message
,
MessageMetadata
,
ConstrainSingle
<
MessageSource
>
{
sealed
class
MessageSource
:
Message
,
MessageMetadata
,
ConstrainSingle
<
MessageSource
>
{
companion
object
Key
:
Message
.
Key
<
MessageSource
>
{
companion
object
Key
:
Message
.
Key
<
MessageSource
>
{
override
val
typeName
:
String
get
()
=
"MessageSource"
override
val
typeName
:
String
get
()
=
"MessageSource"
...
@@ -96,7 +94,6 @@ sealed class MessageSource : Message, MessageMetadata, ConstrainSingle<MessageSo
...
@@ -96,7 +94,6 @@ sealed class MessageSource : Message, MessageMetadata, ConstrainSingle<MessageSo
*
*
* 在事件中和在引用中无法保证同一条消息的 [internalId] 相同.
* 在事件中和在引用中无法保证同一条消息的 [internalId] 相同.
*/
*/
@SinceMirai
(
"0.39.0"
)
abstract
val
internalId
:
Int
abstract
val
internalId
:
Int
/**
/**
...
@@ -167,7 +164,6 @@ sealed class MessageSource : Message, MessageMetadata, ConstrainSingle<MessageSo
...
@@ -167,7 +164,6 @@ sealed class MessageSource : Message, MessageMetadata, ConstrainSingle<MessageSo
*
*
* @see OnlineMessageSource.toOffline 转为 [OfflineMessageSource]
* @see OnlineMessageSource.toOffline 转为 [OfflineMessageSource]
*/
*/
@SinceMirai
(
"0.33.0"
)
@OptIn
(
MiraiExperimentalAPI
::
class
)
@OptIn
(
MiraiExperimentalAPI
::
class
)
sealed
class
OnlineMessageSource
:
MessageSource
()
{
sealed
class
OnlineMessageSource
:
MessageSource
()
{
companion
object
Key
:
Message
.
Key
<
OnlineMessageSource
>
{
companion
object
Key
:
Message
.
Key
<
OnlineMessageSource
>
{
...
@@ -291,7 +287,6 @@ sealed class OnlineMessageSource : MessageSource() {
...
@@ -291,7 +287,6 @@ sealed class OnlineMessageSource : MessageSource() {
*
*
* @see buildMessageSource 构建一个 [OfflineMessageSource]
* @see buildMessageSource 构建一个 [OfflineMessageSource]
*/
*/
@SinceMirai
(
"0.33.0"
)
abstract
class
OfflineMessageSource
:
MessageSource
()
{
abstract
class
OfflineMessageSource
:
MessageSource
()
{
companion
object
Key
:
Message
.
Key
<
OfflineMessageSource
>
{
companion
object
Key
:
Message
.
Key
<
OfflineMessageSource
>
{
override
val
typeName
:
String
override
val
typeName
:
String
...
@@ -301,8 +296,6 @@ abstract class OfflineMessageSource : MessageSource() {
...
@@ -301,8 +296,6 @@ abstract class OfflineMessageSource : MessageSource() {
enum
class
Kind
{
enum
class
Kind
{
GROUP
,
GROUP
,
FRIEND
,
FRIEND
,
@SinceMirai
(
"0.36.0"
)
TEMP
TEMP
}
}
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageSourceBuilder.kt
View file @
84cfe262
...
@@ -19,7 +19,6 @@ import net.mamoe.mirai.contact.Friend
...
@@ -19,7 +19,6 @@ import net.mamoe.mirai.contact.Friend
import
net.mamoe.mirai.contact.Group
import
net.mamoe.mirai.contact.Group
import
net.mamoe.mirai.contact.Member
import
net.mamoe.mirai.contact.Member
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.SinceMirai
import
net.mamoe.mirai.utils.currentTimeSeconds
import
net.mamoe.mirai.utils.currentTimeSeconds
import
kotlin.jvm.JvmMultifileClass
import
kotlin.jvm.JvmMultifileClass
import
kotlin.jvm.JvmName
import
kotlin.jvm.JvmName
...
@@ -28,7 +27,6 @@ import kotlin.jvm.JvmSynthetic
...
@@ -28,7 +27,6 @@ import kotlin.jvm.JvmSynthetic
/**
/**
* 将在线消息源转换为离线消息源.
* 将在线消息源转换为离线消息源.
*/
*/
@SinceMirai
(
"0.39.0"
)
@JvmName
(
"toOfflineMessageSource"
)
@JvmName
(
"toOfflineMessageSource"
)
fun
OnlineMessageSource
.
toOffline
():
OfflineMessageSource
=
fun
OnlineMessageSource
.
toOffline
():
OfflineMessageSource
=
OfflineMessageSourceByOnline
(
this
)
OfflineMessageSourceByOnline
(
this
)
...
@@ -44,7 +42,6 @@ fun OnlineMessageSource.toOffline(): OfflineMessageSource =
...
@@ -44,7 +42,6 @@ fun OnlineMessageSource.toOffline(): OfflineMessageSource =
* @see buildMessageSource 查看更多说明
* @see buildMessageSource 查看更多说明
*/
*/
@MiraiExperimentalAPI
@MiraiExperimentalAPI
@SinceMirai
(
"0.39.0"
)
@JvmName
(
"copySource"
)
@JvmName
(
"copySource"
)
fun
MessageSource
.
copyAmend
(
fun
MessageSource
.
copyAmend
(
block
:
MessageSourceAmender
.()
->
Unit
block
:
MessageSourceAmender
.()
->
Unit
...
@@ -53,7 +50,6 @@ fun MessageSource.copyAmend(
...
@@ -53,7 +50,6 @@ fun MessageSource.copyAmend(
/**
/**
* 仅于 [copyAmend] 中修改 [MessageSource]
* 仅于 [copyAmend] 中修改 [MessageSource]
*/
*/
@SinceMirai
(
"0.39.0"
)
interface
MessageSourceAmender
{
interface
MessageSourceAmender
{
var
kind
:
OfflineMessageSource
.
Kind
var
kind
:
OfflineMessageSource
.
Kind
var
fromUin
:
Long
var
fromUin
:
Long
...
@@ -65,7 +61,6 @@ interface MessageSourceAmender {
...
@@ -65,7 +61,6 @@ interface MessageSourceAmender {
var
originalMessage
:
MessageChain
var
originalMessage
:
MessageChain
/** 从另一个 [MessageSource] 中复制 [id], [internalId], [time]*/
/** 从另一个 [MessageSource] 中复制 [id], [internalId], [time]*/
@SinceMirai
(
"0.39.2"
)
fun
metadataFrom
(
another
:
MessageSource
)
{
fun
metadataFrom
(
another
:
MessageSource
)
{
this
.
id
=
another
.
id
this
.
id
=
another
.
id
this
.
internalId
=
another
.
internalId
this
.
internalId
=
another
.
internalId
...
@@ -107,7 +102,6 @@ interface MessageSourceAmender {
...
@@ -107,7 +102,6 @@ interface MessageSourceAmender {
* }
* }
* ```
* ```
*/
*/
@SinceMirai
(
"0.39.0"
)
@JvmSynthetic
@JvmSynthetic
@MiraiExperimentalAPI
@MiraiExperimentalAPI
fun
Bot
.
buildMessageSource
(
block
:
MessageSourceBuilder
.()
->
Unit
):
MessageSource
{
fun
Bot
.
buildMessageSource
(
block
:
MessageSourceBuilder
.()
->
Unit
):
MessageSource
{
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/QuoteReply.kt
View file @
84cfe262
...
@@ -16,7 +16,6 @@ package net.mamoe.mirai.message.data
...
@@ -16,7 +16,6 @@ package net.mamoe.mirai.message.data
import
kotlinx.coroutines.Job
import
kotlinx.coroutines.Job
import
net.mamoe.mirai.Bot
import
net.mamoe.mirai.Bot
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.SinceMirai
import
kotlin.coroutines.CoroutineContext
import
kotlin.coroutines.CoroutineContext
import
kotlin.coroutines.EmptyCoroutineContext
import
kotlin.coroutines.EmptyCoroutineContext
import
kotlin.jvm.JvmMultifileClass
import
kotlin.jvm.JvmMultifileClass
...
@@ -43,7 +42,6 @@ import kotlin.jvm.JvmSynthetic
...
@@ -43,7 +42,6 @@ import kotlin.jvm.JvmSynthetic
* @see MessageSource 获取有关消息源的更多信息
* @see MessageSource 获取有关消息源的更多信息
*/
*/
@OptIn
(
MiraiExperimentalAPI
::
class
)
@OptIn
(
MiraiExperimentalAPI
::
class
)
@SinceMirai
(
"0.33.0"
)
class
QuoteReply
(
val
source
:
MessageSource
)
:
Message
,
MessageMetadata
,
ConstrainSingle
<
QuoteReply
>
{
class
QuoteReply
(
val
source
:
MessageSource
)
:
Message
,
MessageMetadata
,
ConstrainSingle
<
QuoteReply
>
{
companion
object
Key
:
Message
.
Key
<
QuoteReply
>
{
companion
object
Key
:
Message
.
Key
<
QuoteReply
>
{
override
val
typeName
:
String
override
val
typeName
:
String
...
@@ -68,7 +66,6 @@ inline val QuoteReply.id: Int
...
@@ -68,7 +66,6 @@ inline val QuoteReply.id: Int
/**
/**
* @see MessageSource.internalId
* @see MessageSource.internalId
*/
*/
@SinceMirai
(
"0.39.2"
)
@
get
:
JvmSynthetic
@
get
:
JvmSynthetic
inline
val
QuoteReply
.
internalId
:
Int
inline
val
QuoteReply
.
internalId
:
Int
get
()
=
source
.
internalId
get
()
=
source
.
internalId
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/RichMessage.kt
View file @
84cfe262
...
@@ -14,7 +14,6 @@
...
@@ -14,7 +14,6 @@
package
net.mamoe.mirai.message.data
package
net.mamoe.mirai.message.data
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.SinceMirai
import
kotlin.annotation.AnnotationTarget.*
import
kotlin.annotation.AnnotationTarget.*
import
kotlin.jvm.JvmMultifileClass
import
kotlin.jvm.JvmMultifileClass
import
kotlin.jvm.JvmName
import
kotlin.jvm.JvmName
...
@@ -30,7 +29,6 @@ import kotlin.jvm.JvmSynthetic
...
@@ -30,7 +29,6 @@ import kotlin.jvm.JvmSynthetic
* @see LightApp 小程序 (JSON)
* @see LightApp 小程序 (JSON)
*/
*/
// not using sealed class for customized implementations
// not using sealed class for customized implementations
@SinceMirai
(
"0.27.0"
)
interface
RichMessage
:
MessageContent
{
interface
RichMessage
:
MessageContent
{
/**
/**
...
@@ -49,14 +47,12 @@ interface RichMessage : MessageContent {
...
@@ -49,14 +47,12 @@ interface RichMessage : MessageContent {
* @suppress 此 API 不稳定, 可能在任意时刻被删除
* @suppress 此 API 不稳定, 可能在任意时刻被删除
*/
*/
@MiraiExperimentalAPI
@MiraiExperimentalAPI
@SinceMirai
(
"0.30.0"
)
companion
object
Templates
:
Message
.
Key
<
RichMessage
>
{
companion
object
Templates
:
Message
.
Key
<
RichMessage
>
{
/**
/**
* @suppress 此 API 不稳定, 可能在任意时刻被删除
* @suppress 此 API 不稳定, 可能在任意时刻被删除
*/
*/
@MiraiExperimentalAPI
@MiraiExperimentalAPI
@SinceMirai
(
"0.30.0"
)
fun
share
(
fun
share
(
url
:
String
,
url
:
String
,
title
:
String
?
=
null
,
title
:
String
?
=
null
,
...
@@ -97,7 +93,6 @@ interface RichMessage : MessageContent {
...
@@ -97,7 +93,6 @@ interface RichMessage : MessageContent {
*
*
* @see ServiceMessage 服务消息
* @see ServiceMessage 服务消息
*/
*/
@SinceMirai
(
"0.27.0"
)
data class
LightApp
(
override
val
content
:
String
)
:
RichMessage
{
data class
LightApp
(
override
val
content
:
String
)
:
RichMessage
{
companion
object
Key
:
Message
.
Key
<
LightApp
>
{
companion
object
Key
:
Message
.
Key
<
LightApp
>
{
override
val
typeName
:
String
get
()
=
"LightApp"
override
val
typeName
:
String
get
()
=
"LightApp"
...
@@ -116,7 +111,6 @@ data class LightApp(override val content: String) : RichMessage {
...
@@ -116,7 +111,6 @@ data class LightApp(override val content: String) : RichMessage {
*
*
* @see LightApp 小程序类型消息
* @see LightApp 小程序类型消息
*/
*/
@SinceMirai
(
"0.37.3"
)
open
class
ServiceMessage
(
val
serviceId
:
Int
,
final
override
val
content
:
String
)
:
RichMessage
{
open
class
ServiceMessage
(
val
serviceId
:
Int
,
final
override
val
content
:
String
)
:
RichMessage
{
companion
object
Key
:
Message
.
Key
<
ServiceMessage
>
{
companion
object
Key
:
Message
.
Key
<
ServiceMessage
>
{
override
val
typeName
:
String
get
()
=
"ServiceMessage"
override
val
typeName
:
String
get
()
=
"ServiceMessage"
...
@@ -153,7 +147,6 @@ commonElem=CommonElem#750141174 {
...
@@ -153,7 +147,6 @@ commonElem=CommonElem#750141174 {
*/
*/
@Suppress
(
"DEPRECATION_ERROR"
)
@Suppress
(
"DEPRECATION_ERROR"
)
@JvmSynthetic
@JvmSynthetic
@SinceMirai
(
"0.27.0"
)
@MiraiExperimentalAPI
@MiraiExperimentalAPI
inline
fun
buildXmlMessage
(
serviceId
:
Int
,
block
:
@XmlMessageDsl
XmlMessageBuilder
.()
->
Unit
):
ServiceMessage
=
inline
fun
buildXmlMessage
(
serviceId
:
Int
,
block
:
@XmlMessageDsl
XmlMessageBuilder
.()
->
Unit
):
ServiceMessage
=
ServiceMessage
(
serviceId
,
XmlMessageBuilder
().
apply
(
block
).
text
)
ServiceMessage
(
serviceId
,
XmlMessageBuilder
().
apply
(
block
).
text
)
...
@@ -205,8 +198,6 @@ class XmlMessageBuilder(
...
@@ -205,8 +198,6 @@ class XmlMessageBuilder(
sourceName
=
name
sourceName
=
name
sourceIconURL
=
iconURL
sourceIconURL
=
iconURL
}
}
@SinceMirai
(
"0.27.0"
)
@XmlMessageDsl
@XmlMessageDsl
class
ItemBuilder
@PublishedApi
internal
constructor
(
class
ItemBuilder
@PublishedApi
internal
constructor
(
var
bg
:
Int
=
0
,
var
bg
:
Int
=
0
,
...
@@ -229,9 +220,6 @@ class XmlMessageBuilder(
...
@@ -229,9 +220,6 @@ class XmlMessageBuilder(
}
}
}
}
}
}
@SinceMirai
(
"0.31.0"
)
@MiraiExperimentalAPI
@MiraiExperimentalAPI
internal
class
LongMessage
internal
constructor
(
content
:
String
,
val
resId
:
String
)
:
ServiceMessage
(
35
,
content
)
{
internal
class
LongMessage
internal
constructor
(
content
:
String
,
val
resId
:
String
)
:
ServiceMessage
(
35
,
content
)
{
companion
object
Key
:
Message
.
Key
<
LongMessage
>
{
companion
object
Key
:
Message
.
Key
<
LongMessage
>
{
...
@@ -240,5 +228,4 @@ internal class LongMessage internal constructor(content: String, val resId: Stri
...
@@ -240,5 +228,4 @@ internal class LongMessage internal constructor(content: String, val resId: Stri
}
}
@OptIn
(
MiraiExperimentalAPI
::
class
)
@OptIn
(
MiraiExperimentalAPI
::
class
)
@SinceMirai
(
"0.39.0"
)
internal
class
ForwardMessageInternal
(
content
:
String
)
:
ServiceMessage
(
35
,
content
)
internal
class
ForwardMessageInternal
(
content
:
String
)
:
ServiceMessage
(
35
,
content
)
\ No newline at end of file
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/BotConfiguration.kt
View file @
84cfe262
...
@@ -144,13 +144,9 @@ open class BotConfiguration {
...
@@ -144,13 +144,9 @@ open class BotConfiguration {
* ```
* ```
*/
*/
@ConfigurationDsl
@ConfigurationDsl
@SinceMirai
(
"0.38.0"
)
suspend
fun
inheritCoroutineContext
()
{
suspend
fun
inheritCoroutineContext
()
{
parentCoroutineContext
=
coroutineContext
parentCoroutineContext
=
coroutineContext
}
}
@SinceMirai
(
"0.38.0"
)
@DslMarker
@DslMarker
annotation
class
ConfigurationDsl
annotation
class
ConfigurationDsl
}
}
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/SoftRef.kt
View file @
84cfe262
...
@@ -43,7 +43,6 @@ inline operator fun <T> UnsafeSoftRef<T>.getValue(thisRef: Any?, property: KProp
...
@@ -43,7 +43,6 @@ inline operator fun <T> UnsafeSoftRef<T>.getValue(thisRef: Any?, property: KProp
* @see softRef provides a SoftRef
* @see softRef provides a SoftRef
* @see unsafeSoftRef provides a UnsafeSoftRef
* @see unsafeSoftRef provides a UnsafeSoftRef
*/
*/
@SinceMirai("0.32.0")
expect class SoftRef<T>(referent: T) {
expect class SoftRef<T>(referent: T) {
fun get(): T?
fun get(): T?
fun clear()
fun clear()
...
...
mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/LoginSolver.swing.jvm.kt
View file @
84cfe262
...
@@ -20,7 +20,6 @@ import javax.swing.JTextField
...
@@ -20,7 +20,6 @@ import javax.swing.JTextField
/**
/**
* @author Karlatemp <karlatemp@vip.qq.com> <https://github.com/Karlatemp>
* @author Karlatemp <karlatemp@vip.qq.com> <https://github.com/Karlatemp>
*/
*/
@SinceMirai
(
"0.39.2"
)
@MiraiExperimentalAPI
@MiraiExperimentalAPI
object
SwingSolver
:
LoginSolver
()
{
object
SwingSolver
:
LoginSolver
()
{
override
suspend
fun
onSolvePicCaptcha
(
bot
:
Bot
,
data
:
ByteArray
):
String
?
{
override
suspend
fun
onSolvePicCaptcha
(
bot
:
Bot
,
data
:
ByteArray
):
String
?
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment