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
3c9b057a
Commit
3c9b057a
authored
Apr 22, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `Identified` to `ContactOrBot`, remove experimental annotations
parent
15527b56
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
21 deletions
+8
-21
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt
+1
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
.../src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
+3
-3
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/ContactOrBot.kt
...commonMain/kotlin/net.mamoe.mirai/contact/ContactOrBot.kt
+2
-15
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageSource.kt
...Main/kotlin/net.mamoe.mirai/message/data/MessageSource.kt
+2
-2
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt
View file @
3c9b057a
...
@@ -50,7 +50,7 @@ suspend inline fun <B : Bot> B.alsoLogin(): B = also { login() }
...
@@ -50,7 +50,7 @@ suspend inline fun <B : Bot> B.alsoLogin(): B = also { login() }
*/
*/
@Suppress
(
"INAPPLICABLE_JVM_NAME"
)
@Suppress
(
"INAPPLICABLE_JVM_NAME"
)
@OptIn
(
MiraiInternalAPI
::
class
,
LowLevelAPI
::
class
)
@OptIn
(
MiraiInternalAPI
::
class
,
LowLevelAPI
::
class
)
abstract
class
Bot
:
CoroutineScope
,
LowLevelBotAPIAccessor
,
BotJavaFriendlyAPI
(),
Identified
{
abstract
class
Bot
:
CoroutineScope
,
LowLevelBotAPIAccessor
,
BotJavaFriendlyAPI
(),
ContactOrBot
{
companion
object
{
companion
object
{
/**
/**
* 复制一份此时的 [Bot] 实例列表.
* 复制一份此时的 [Bot] 实例列表.
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
View file @
3c9b057a
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
*/
*/
@
file
:
Suppress
(
"EXPERIMENTAL_API_USAGE"
,
"NOTHING_TO_INLINE"
,
"EXPERIMENTAL_OVERRIDE"
)
@
file
:
Suppress
(
"EXPERIMENTAL_API_USAGE"
,
"NOTHING_TO_INLINE"
,
"EXPERIMENTAL_OVERRIDE"
)
@
file
:
OptIn
(
MiraiInternalAPI
::
class
,
JavaFriendlyAPI
::
class
)
package
net.mamoe.mirai.contact
package
net.mamoe.mirai.contact
...
@@ -34,9 +35,8 @@ import kotlin.jvm.JvmSynthetic
...
@@ -34,9 +35,8 @@ import kotlin.jvm.JvmSynthetic
* 联系人. 虽然叫做联系人, 但他的子类有 [QQ], [群成员][Member] 和 [群][Group].
* 联系人. 虽然叫做联系人, 但他的子类有 [QQ], [群成员][Member] 和 [群][Group].
*
*
* @author Him188moe
* @author Him188moe
*/
// 不要删除多平台结构 !!! kotlin bug
*/
@OptIn
(
MiraiInternalAPI
::
class
,
JavaFriendlyAPI
::
class
)
abstract
class
Contact
:
CoroutineScope
,
ContactJavaFriendlyAPI
(),
ContactOrBot
{
abstract
class
Contact
:
CoroutineScope
,
ContactJavaFriendlyAPI
(),
Identified
{
/**
/**
* 这个联系人所属 [Bot].
* 这个联系人所属 [Bot].
*/
*/
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/
Identified
.kt
→
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/
ContactOrBot
.kt
View file @
3c9b057a
...
@@ -20,23 +20,10 @@ import net.mamoe.mirai.utils.SinceMirai
...
@@ -20,23 +20,10 @@ import net.mamoe.mirai.utils.SinceMirai
* @see Contact
* @see Contact
* @see Bot
* @see Bot
*/
*/
@ExperimentalIdentification
(
"classname may change"
)
@SinceMirai
(
"0.37.2"
)
@SinceMirai
(
"0.37.2"
)
interface
Identified
{
interface
ContactOrBot
{
/**
/**
* QQ 号或群号.
* QQ 号或群号.
*/
*/
val
id
:
Long
val
id
:
Long
}
}
\ No newline at end of file
/**
* 标记使用实验性 [Identified] 接口.
*/
@Retention
(
AnnotationRetention
.
SOURCE
)
@RequiresOptIn
(
level
=
RequiresOptIn
.
Level
.
WARNING
)
@Target
(
AnnotationTarget
.
CLASS
,
AnnotationTarget
.
TYPEALIAS
,
AnnotationTarget
.
FUNCTION
,
AnnotationTarget
.
PROPERTY
,
AnnotationTarget
.
FIELD
,
AnnotationTarget
.
CONSTRUCTOR
)
annotation
class
ExperimentalIdentification
(
val
message
:
String
=
""
)
\ No newline at end of file
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageSource.kt
View file @
3c9b057a
...
@@ -117,14 +117,14 @@ sealed class OnlineMessageSource : MessageSource() {
...
@@ -117,14 +117,14 @@ sealed class OnlineMessageSource : MessageSource() {
* 即类型必定为 [Bot], [QQ] 或 [Member]
* 即类型必定为 [Bot], [QQ] 或 [Member]
*/
*/
@ExperimentalIdentification
@ExperimentalIdentification
abstract
val
sender
:
Identified
abstract
val
sender
:
ContactOrBot
/**
/**
* 消息发送目标. 可能为 [机器人][Bot] 或 [好友][QQ] 或 [群][Group].
* 消息发送目标. 可能为 [机器人][Bot] 或 [好友][QQ] 或 [群][Group].
* 即类型必定为 [Bot], [QQ] 或 [Group]
* 即类型必定为 [Bot], [QQ] 或 [Group]
*/
*/
@ExperimentalIdentification
@ExperimentalIdentification
abstract
val
target
:
Identified
abstract
val
target
:
ContactOrBot
/**
/**
* 消息主体. 群消息时为 [Group]. 好友消息时为 [QQ], 临时消息为 [Member]
* 消息主体. 群消息时为 [Group]. 好友消息时为 [QQ], 临时消息为 [Member]
...
...
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