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
f98d57fb
Commit
f98d57fb
authored
Feb 29, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `MessageRecallEvent`
parent
2da9f559
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
16 deletions
+12
-16
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt
...mmonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt
+12
-16
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt
View file @
f98d57fb
...
...
@@ -114,27 +114,23 @@ sealed class MessageRecallEvent : BotEvent {
*/
abstract
val
messageTime
:
Int
// seconds
data class
ByBot
(
data class
GroupRecall
(
override
val
bot
:
Bot
,
override
val
authorId
:
Long
,
override
val
messageId
:
Long
,
override
val
messageTime
:
Int
)
:
MessageRecallEvent
(),
BotActiveEvent
,
CancellableEvent
{
override
val
isCancelled
:
Boolean
get
()
=
cancelled
private
var
cancelled
:
Boolean
=
false
// 无法多继承
override
fun
cancel
()
{
cancelled
=
true
}
}
data class
ByOthers
(
override
val
bot
:
Bot
,
override
val
authorId
:
Long
,
override
val
messageId
:
Long
,
override
val
messageTime
:
Int
)
:
MessageRecallEvent
(),
BotPassiveEvent
,
Packet
override
val
messageTime
:
Int
,
/**
* 操作人. 为 null 是
*/
override
val
operator
:
Member
?,
override
val
group
:
Group
)
:
MessageRecallEvent
(),
OperableEvent
,
Packet
}
@UseExperimental
(
MiraiExperimentalAPI
::
class
)
val
MessageRecallEvent
.
GroupRecall
.
author
:
Member
get
()
=
if
(
authorId
==
bot
.
uin
)
group
.
botAsMember
else
group
[
authorId
]
// endregion
// region 图片
...
...
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