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
7ffbccb9
Commit
7ffbccb9
authored
Feb 22, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Misc improvements
parent
7e3ede0d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
.../src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
+4
-2
mirai-japt/src/main/kotlin/net/mamoe/mirai/japt/internal/BlockingBotImpl.kt
...n/kotlin/net/mamoe/mirai/japt/internal/BlockingBotImpl.kt
+1
-1
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
View file @
7ffbccb9
...
...
@@ -92,6 +92,8 @@ interface Contact : CoroutineScope {
override
fun
toString
():
String
}
suspend
inline
fun
Contact
.
sendMessage
(
message
:
Message
)
=
sendMessage
(
message
.
toChain
())
@Suppress
(
"UNCHECKED_CAST"
)
suspend
inline
fun
<
C
:
Contact
>
C
.
sendMessage
(
message
:
Message
):
MessageReceipt
<
C
>
=
sendMessage
(
message
.
toChain
())
as
?
MessageReceipt
<
C
>
?:
error
(
"Internal class cast mistake"
)
suspend
inline
fun
Contact
.
sendMessage
(
plain
:
String
)
=
sendMessage
(
plain
.
toMessage
())
\ No newline at end of file
suspend
inline
fun
<
C
:
Contact
>
C
.
sendMessage
(
plain
:
String
):
MessageReceipt
<
C
>
=
sendMessage
(
plain
.
toMessage
())
\ No newline at end of file
mirai-japt/src/main/kotlin/net/mamoe/mirai/japt/internal/BlockingBotImpl.kt
View file @
7ffbccb9
...
...
@@ -31,6 +31,7 @@ import java.io.OutputStream
import
java.util.stream.Stream
import
kotlin.streams.asStream
@UseExperimental
(
MiraiInternalAPI
::
class
,
MiraiExperimentalAPI
::
class
)
internal
class
BlockingBotImpl
(
private
val
bot
:
Bot
)
:
BlockingBot
{
@MiraiInternalAPI
override
fun
getAccount
():
BotAccount
=
bot
.
account
...
...
@@ -51,7 +52,6 @@ internal class BlockingBotImpl(private val bot: Bot) : BlockingBot {
override
fun
getFriend
(
id
:
Long
):
BlockingQQ
=
bot
.
getFriend
(
id
).
blocking
()
override
fun
queryGroupList
():
Stream
<
Long
>
=
runBlocking
{
bot
.
queryGroupList
()
}.
asStream
()
@UseExperimental
(
MiraiInternalAPI
::
class
)
override
fun
getGroupList
():
List
<
BlockingGroup
>
=
bot
.
groups
.
delegate
.
toList
().
map
{
it
.
blocking
()
}
override
fun
queryGroupInfo
(
code
:
Long
):
GroupInfo
=
runBlocking
{
bot
.
queryGroupInfo
(
code
)
}
...
...
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