mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-13 03:16:05 +08:00
Fix #253
This commit is contained in:
parent
66f4620292
commit
3545482034
@ -313,6 +313,7 @@ internal abstract class QQAndroidBotBase constructor(
|
|||||||
this,
|
this,
|
||||||
source.fromId,
|
source.fromId,
|
||||||
source.id,
|
source.id,
|
||||||
|
source.internalId,
|
||||||
source.time,
|
source.time,
|
||||||
null,
|
null,
|
||||||
group
|
group
|
||||||
|
@ -381,7 +381,13 @@ internal class OnlinePush {
|
|||||||
when {
|
when {
|
||||||
pkg.authorUin == bot.id && operator.id == bot.id -> null
|
pkg.authorUin == bot.id && operator.id == bot.id -> null
|
||||||
else -> {
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,17 +122,25 @@ sealed class MessageRecallEvent : BotEvent {
|
|||||||
*/
|
*/
|
||||||
abstract val messageId: Int
|
abstract val messageId: Int
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息内部 id.
|
||||||
|
* @see MessageSource.id
|
||||||
|
*/
|
||||||
|
@SinceMirai("0.39.0")
|
||||||
|
abstract val messageInternalId: Int
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 原发送时间
|
* 原发送时间
|
||||||
*/
|
*/
|
||||||
abstract val messageTime: Int // seconds
|
abstract val messageTime: Int // seconds
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 好友消息撤回事件, 暂不支持解析.
|
* 好友消息撤回事件, 暂不支持.
|
||||||
*/
|
*/ // TODO: 2020/4/22 支持好友消息撤回事件的解析和主动广播
|
||||||
data class FriendRecall(
|
data class FriendRecall(
|
||||||
override val bot: Bot,
|
override val bot: Bot,
|
||||||
override val messageId: Int,
|
override val messageId: Int,
|
||||||
|
override val messageInternalId: Int,
|
||||||
override val messageTime: Int,
|
override val messageTime: Int,
|
||||||
/**
|
/**
|
||||||
* 撤回操作人, 可能为 [Bot.uin] 或好友的 [QQ.id]
|
* 撤回操作人, 可能为 [Bot.uin] 或好友的 [QQ.id]
|
||||||
@ -143,10 +151,14 @@ sealed class MessageRecallEvent : BotEvent {
|
|||||||
get() = bot.id
|
get() = bot.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 群消息撤回事件.
|
||||||
|
*/
|
||||||
data class GroupRecall(
|
data class GroupRecall(
|
||||||
override val bot: Bot,
|
override val bot: Bot,
|
||||||
override val authorId: Long,
|
override val authorId: Long,
|
||||||
override val messageId: Int,
|
override val messageId: Int,
|
||||||
|
override val messageInternalId: Int,
|
||||||
override val messageTime: Int,
|
override val messageTime: Int,
|
||||||
/**
|
/**
|
||||||
* 操作人. 为 null 时则为 [Bot] 操作.
|
* 操作人. 为 null 时则为 [Bot] 操作.
|
||||||
|
@ -63,6 +63,7 @@ sealed class MessageSource : Message, MessageMetadata, ConstrainSingle<MessageSo
|
|||||||
/**
|
/**
|
||||||
* 内部 id, 仅用于 [Bot.constructMessageSource]
|
* 内部 id, 仅用于 [Bot.constructMessageSource]
|
||||||
* 值没有顺序, 也可能为 0, 取决于服务器是否提供.
|
* 值没有顺序, 也可能为 0, 取决于服务器是否提供.
|
||||||
|
* 在事件中和在引用中无法保证同一条消息的 [internalId] 相同.
|
||||||
*
|
*
|
||||||
* 仅用于协议实现.
|
* 仅用于协议实现.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user