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
e58665f9
Commit
e58665f9
authored
Nov 02, 2019
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs update
parent
e2d04f71
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/BotHelper.kt
...i-core/src/commonMain/kotlin/net.mamoe.mirai/BotHelper.kt
+1
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
.../src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
+5
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/Message.kt
.../src/commonMain/kotlin/net.mamoe.mirai/message/Message.kt
+2
-2
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/BotHelper.kt
View file @
e58665f9
...
...
@@ -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
))
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
View file @
e58665f9
...
...
@@ -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
)
/**
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/Message.kt
View file @
e58665f9
...
...
@@ -417,7 +417,7 @@ class EmptyMessageChain : MessageChain {
* Null 的 [MessageChain].
* 它不包含任何元素, 也没有创建任何 list.
*
* - 所有 get 方法均抛出 [
NoSuchElement
Exception]
* - 所有 get 方法均抛出 [
IndexOutOfBounds
Exception]
* - 所有 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
NoSuchElement
Exception
()
override
fun
get
(
index
:
Int
):
Message
=
throw
IndexOutOfBounds
Exception
()
override
fun
indexOf
(
element
:
Message
):
Int
=
-
1
override
fun
isEmpty
():
Boolean
=
true
override
fun
iterator
():
MutableIterator
<
Message
>
=
EmptyMutableIterator
()
...
...
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