This commit is contained in:
Him188 2020-04-22 18:39:10 +08:00
parent 66f4620292
commit 3545482034
4 changed files with 23 additions and 3 deletions

View File

@ -313,6 +313,7 @@ internal abstract class QQAndroidBotBase constructor(
this,
source.fromId,
source.id,
source.internalId,
source.time,
null,
group

View File

@ -381,7 +381,13 @@ internal class OnlinePush {
when {
pkg.authorUin == bot.id && operator.id == bot.id -> null
else -> {
MessageRecallEvent.GroupRecall(bot, pkg.authorUin, pkg.msgRandom, pkg.time, operator, group)
MessageRecallEvent.GroupRecall(bot,
pkg.authorUin,
pkg.seq,
pkg.msgRandom,
pkg.time,
operator,
group)
}
}
}

View File

@ -122,17 +122,25 @@ sealed class MessageRecallEvent : BotEvent {
*/
abstract val messageId: Int
/**
* 消息内部 id.
* @see MessageSource.id
*/
@SinceMirai("0.39.0")
abstract val messageInternalId: Int
/**
* 原发送时间
*/
abstract val messageTime: Int // seconds
/**
* 好友消息撤回事件, 暂不支持解析.
*/
* 好友消息撤回事件, 暂不支持.
*/ // TODO: 2020/4/22 支持好友消息撤回事件的解析和主动广播
data class FriendRecall(
override val bot: Bot,
override val messageId: Int,
override val messageInternalId: Int,
override val messageTime: Int,
/**
* 撤回操作人, 可能为 [Bot.uin] 或好友的 [QQ.id]
@ -143,10 +151,14 @@ sealed class MessageRecallEvent : BotEvent {
get() = bot.id
}
/**
* 群消息撤回事件.
*/
data class GroupRecall(
override val bot: Bot,
override val authorId: Long,
override val messageId: Int,
override val messageInternalId: Int,
override val messageTime: Int,
/**
* 操作人. null 时则为 [Bot] 操作.

View File

@ -63,6 +63,7 @@ sealed class MessageSource : Message, MessageMetadata, ConstrainSingle<MessageSo
/**
* 内部 id, 仅用于 [Bot.constructMessageSource]
* 值没有顺序, 也可能为 0, 取决于服务器是否提供.
* 在事件中和在引用中无法保证同一条消息的 [internalId] 相同.
*
* 仅用于协议实现.
*/