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
558ece3a
Commit
558ece3a
authored
Nov 16, 2019
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comments
parent
0978d284
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
1 deletion
+9
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/MiraiEnvironment.kt
...src/commonMain/kotlin/net.mamoe.mirai/MiraiEnvironment.kt
+6
-0
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/Annotations.kt
...rc/commonMain/kotlin/net.mamoe.mirai/utils/Annotations.kt
+1
-0
mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/DefaultCaptchaSolverJvm.kt
...n/kotlin/net/mamoe/mirai/utils/DefaultCaptchaSolverJvm.kt
+0
-1
mirai-demos/mirai-demo-1/src/main/java/demo/subscribe/SubscribeSamples.kt
...i-demo-1/src/main/java/demo/subscribe/SubscribeSamples.kt
+1
-0
mirai-demos/mirai-demo-gentleman/src/main/kotlin/demo/gentleman/Main.kt
...rai-demo-gentleman/src/main/kotlin/demo/gentleman/Main.kt
+1
-0
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/MiraiEnvironment.kt
View file @
558ece3a
package
net.mamoe.mirai
package
net.mamoe.mirai
/**
* 平台相关环境属性
*/
expect
object
MiraiEnvironment
{
expect
object
MiraiEnvironment
{
val
platform
:
Platform
val
platform
:
Platform
}
}
/**
* 可用平台列表
*/
enum
class
Platform
{
enum
class
Platform
{
ANDROID
,
ANDROID
,
JVM
JVM
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/Annotations.kt
View file @
558ece3a
...
@@ -4,6 +4,7 @@ package net.mamoe.mirai.utils
...
@@ -4,6 +4,7 @@ package net.mamoe.mirai.utils
* 标记这个类, 类型, 函数, 属性, 字段, 或构造器为一个仅供 Mirai 内部使用的 API.
* 标记这个类, 类型, 函数, 属性, 字段, 或构造器为一个仅供 Mirai 内部使用的 API.
*
*
* 这些 API 可能会在任意时刻更改, 且不会发布任何预警.
* 这些 API 可能会在任意时刻更改, 且不会发布任何预警.
* 我们非常不建议使用这些 API.
*/
*/
@Experimental
(
level
=
Experimental
.
Level
.
ERROR
)
@Experimental
(
level
=
Experimental
.
Level
.
ERROR
)
@Target
(
@Target
(
...
...
mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/DefaultCaptchaSolverJvm.kt
View file @
558ece3a
...
@@ -63,7 +63,6 @@ private val captchaLock = Mutex()
...
@@ -63,7 +63,6 @@ private val captchaLock = Mutex()
/**
/**
* @author NaturalHG
* @author NaturalHG
*/
*/
@JvmOverloads
private
fun
BufferedImage
.
createCharImg
(
outputWidth
:
Int
=
100
,
ignoreRate
:
Double
=
0.95
):
String
{
private
fun
BufferedImage
.
createCharImg
(
outputWidth
:
Int
=
100
,
ignoreRate
:
Double
=
0.95
):
String
{
val
newHeight
=
(
this
.
height
*
(
outputWidth
.
toDouble
()
/
this
.
width
)).
toInt
()
val
newHeight
=
(
this
.
height
*
(
outputWidth
.
toDouble
()
/
this
.
width
)).
toInt
()
val
tmp
=
this
.
getScaledInstance
(
outputWidth
,
newHeight
,
Image
.
SCALE_SMOOTH
)
val
tmp
=
this
.
getScaledInstance
(
outputWidth
,
newHeight
,
Image
.
SCALE_SMOOTH
)
...
...
mirai-demos/mirai-demo-1/src/main/java/demo/subscribe/SubscribeSamples.kt
View file @
558ece3a
...
@@ -107,6 +107,7 @@ suspend fun Bot.messageDSL() {
...
@@ -107,6 +107,7 @@ suspend fun Bot.messageDSL() {
//如果是群消息
//如果是群消息
// group: Group
// group: Group
this
.
group
.
sendMessage
(
"你在一个群里"
)
this
.
group
.
sendMessage
(
"你在一个群里"
)
// 等同于 reply("你在一个群里")
}
}
reply
(
"图片, ID= ${message[Image].id}"
)
//获取第一个 Image 类型的消息
reply
(
"图片, ID= ${message[Image].id}"
)
//获取第一个 Image 类型的消息
...
...
mirai-demos/mirai-demo-gentleman/src/main/kotlin/demo/gentleman/Main.kt
View file @
558ece3a
...
@@ -67,6 +67,7 @@ suspend fun main() {
...
@@ -67,6 +67,7 @@ suspend fun main() {
if
(
this
is
FriendMessage
)
{
if
(
this
is
FriendMessage
)
{
withContext
(
IO
)
{
withContext
(
IO
)
{
val
image
:
Image
by
message
val
image
:
Image
by
message
// 等同于 val image = message[Image]
reply
(
image
+
" downloading"
)
reply
(
image
+
" downloading"
)
image
.
downloadTo
(
newTestTempFile
(
suffix
=
".png"
).
also
{
reply
(
"Temp file: ${it.absolutePath}"
)
})
image
.
downloadTo
(
newTestTempFile
(
suffix
=
".png"
).
also
{
reply
(
"Temp file: ${it.absolutePath}"
)
})
...
...
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