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
45784c01
Commit
45784c01
authored
Apr 13, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce experimental common super interface `Identified` for Contact and Bot
parent
e10e404c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
5 deletions
+35
-5
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt
+2
-2
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/Identified.kt
...c/commonMain/kotlin/net.mamoe.mirai/contact/Identified.kt
+30
-0
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/Bot.kt
View file @
45784c01
...
@@ -48,7 +48,7 @@ suspend inline fun <B : Bot> B.alsoLogin(): B = also { login() }
...
@@ -48,7 +48,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
()
{
abstract
class
Bot
:
CoroutineScope
,
LowLevelBotAPIAccessor
,
BotJavaFriendlyAPI
()
,
Identified
{
companion
object
{
companion
object
{
/**
/**
* 复制一份此时的 [Bot] 实例列表.
* 复制一份此时的 [Bot] 实例列表.
...
@@ -85,7 +85,7 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
...
@@ -85,7 +85,7 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
* QQ 号码. 实际类型为 uint
* QQ 号码. 实际类型为 uint
*/
*/
@SinceMirai
(
"0.32.0"
)
@SinceMirai
(
"0.32.0"
)
abstract
val
id
:
Long
abstract
override
val
id
:
Long
/**
/**
* 昵称
* 昵称
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
View file @
45784c01
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
*/
@
file
:
Suppress
(
"EXPERIMENTAL_API_USAGE"
,
"NOTHING_TO_INLINE"
)
@
file
:
Suppress
(
"EXPERIMENTAL_API_USAGE"
,
"NOTHING_TO_INLINE"
,
"EXPERIMENTAL_OVERRIDE"
)
package
net.mamoe.mirai.contact
package
net.mamoe.mirai.contact
...
@@ -36,7 +36,7 @@ import kotlin.jvm.JvmSynthetic
...
@@ -36,7 +36,7 @@ import kotlin.jvm.JvmSynthetic
* @author Him188moe
* @author Him188moe
*/
// 不要删除多平台结构 !!! kotlin bug
*/
// 不要删除多平台结构 !!! kotlin bug
@OptIn
(
MiraiInternalAPI
::
class
,
JavaFriendlyAPI
::
class
)
@OptIn
(
MiraiInternalAPI
::
class
,
JavaFriendlyAPI
::
class
)
abstract
class
Contact
:
CoroutineScope
,
ContactJavaFriendlyAPI
()
{
abstract
class
Contact
:
CoroutineScope
,
ContactJavaFriendlyAPI
()
,
Identified
{
/**
/**
* 这个联系人所属 [Bot].
* 这个联系人所属 [Bot].
*/
*/
...
@@ -52,7 +52,7 @@ abstract class Contact : CoroutineScope, ContactJavaFriendlyAPI() {
...
@@ -52,7 +52,7 @@ abstract class Contact : CoroutineScope, ContactJavaFriendlyAPI() {
* @see QQ.id
* @see QQ.id
* @see Group.id
* @see Group.id
*/
*/
abstract
val
id
:
Long
abstract
override
val
id
:
Long
/**
/**
* 向这个对象发送消息.
* 向这个对象发送消息.
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Identified.kt
0 → 100644
View file @
45784c01
/*
* Copyright 2020 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
package
net.mamoe.mirai.contact
import
net.mamoe.mirai.Bot
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.SinceMirai
/**
* 拥有 [id] 的对象.
* 此为 [Contact] 与 [Bot] 的唯一公共接口.
*
* @see Contact
* @see Bot
*/
@MiraiExperimentalAPI
(
"classname may change"
)
@SinceMirai
(
"0.38.0"
)
interface
Identified
{
/**
* QQ 号或群号.
*/
val
id
:
Long
}
\ No newline at end of file
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