Class MiraiStrangerMessagePostSendEvent
java.lang.Object
org.spongepowered.api.event.impl.AbstractEvent
me.dreamvoid.miraimc.sponge.event.message.postsend.MiraiStrangerMessagePostSendEvent
- All Implemented Interfaces:
org.spongepowered.api.event.Event
public class MiraiStrangerMessagePostSendEvent
extends org.spongepowered.api.event.impl.AbstractEvent
(Sponge) 消息 - 主动发送消息后 - 陌生人消息
-
Field Summary
Fields inherited from class org.spongepowered.api.event.impl.AbstractEvent
currentOrder -
Constructor Summary
ConstructorsConstructorDescriptionMiraiStrangerMessagePostSendEvent(net.mamoe.mirai.event.events.StrangerMessagePostSendEvent event, org.spongepowered.api.event.Cause cause) -
Method Summary
Modifier and TypeMethodDescription@NotNull org.spongepowered.api.event.Causecause()longgetBotID()返回发送这条信息的机器人ID返回接收者的备注名返回接收到的消息内容转换到字符串的结果
此方法使用 contentToString()
QQ 对话框中以纯文本方式会显示的消息内容,这适用于MC与QQ的消息互通等不方便展示原始内容的场景。Deprecated.返回接收到的消息内容转换到Mirai Code的结果
此方法使用 serializeToMiraiCode()
转换为对应的 Mirai 码,消息的一种序列化方式返回接收到的消息内容
此方法使用 toString()
Java 对象的 toString(),会尽可能包含多的信息用于调试作用,行为可能不确定
如需处理常规消息内容,请使用getMessageContent()@Nullable String返回被回复的消息内容转换到字符串的结果,如果不存在回复消息,返回null
此方法使用 contentToString()
QQ 对话框中以纯文本方式会显示的消息内容,这适用于MC与QQ的消息互通等不方便展示原始内容的场景。@Nullable String返回被回复的消息内容转换到字符串的结果,如果不存在回复消息,返回null
此方法使用 contentToString()
QQ 对话框中以纯文本方式会显示的消息内容,这适用于MC与QQ的消息互通等不方便展示原始内容的场景。@Nullable String返回被回复的消息内容转换到字符串的结果,如果不存在回复消息,返回null
此方法使用 serializeToMiraiCode()
转换为对应的 Mirai 码,消息的一种序列化方式@Nullable String返回被回复的消息内容转换到字符串的结果,如果不存在回复消息,返回null
此方法使用 toString()
Java 对象的 toString(),会尽可能包含多的信息用于调试作用,行为可能不确定
如需处理常规消息内容,请使用getQuoteReplyMessage()long返回被回复的消息的发送者long返回接收者ID返回接收这条信息的目标昵称voidrecall()撤回这条消息voidrecall(long delayTime) 等待指定时间后撤回这条消息
此方法执行异步(Async)任务toString()获取原始事件内容
[!]Methods inherited from class org.spongepowered.api.event.impl.AbstractEvent
initMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.spongepowered.api.event.Event
context, source
-
Constructor Details
-
MiraiStrangerMessagePostSendEvent
public MiraiStrangerMessagePostSendEvent(net.mamoe.mirai.event.events.StrangerMessagePostSendEvent event, org.spongepowered.api.event.Cause cause)
-
-
Method Details
-
getTargetNick
返回接收这条信息的目标昵称- Returns:
- 目标昵称
-
getFriendRemark
返回接收者的备注名- Returns:
- 备注名
-
getBotID
public long getBotID()返回发送这条信息的机器人ID- Returns:
- 机器人ID
-
getTargetID
public long getTargetID()返回接收者ID- Returns:
- 可以是QQ号或群号
-
getMessage
返回接收到的消息内容转换到字符串的结果
此方法使用 contentToString()
QQ 对话框中以纯文本方式会显示的消息内容,这适用于MC与QQ的消息互通等不方便展示原始内容的场景。
无法用纯文字表示的消息会丢失信息,如任何图片都是 [图片]- Returns:
- 转换字符串后的消息内容
-
getMessageContent
Deprecated.返回接收到的消息内容转换到字符串的结果
此方法使用 contentToString()
QQ 对话框中以纯文本方式会显示的消息内容,这适用于MC与QQ的消息互通等不方便展示原始内容的场景。
无法用纯文字表示的消息会丢失信息,如任何图片都是 [图片]- Returns:
- 转换字符串后的消息内容
- See Also:
-
getMessageToMiraiCode
返回接收到的消息内容转换到Mirai Code的结果
此方法使用 serializeToMiraiCode()
转换为对应的 Mirai 码,消息的一种序列化方式- Returns:
- 带Mirai Code的消息内容
-
getMessageToString
返回接收到的消息内容
此方法使用 toString()
Java 对象的 toString(),会尽可能包含多的信息用于调试作用,行为可能不确定
如需处理常规消息内容,请使用getMessageContent()- Returns:
- 原始消息内容
-
toString
获取原始事件内容
[!] 不推荐使用 -
recall
public void recall()撤回这条消息 -
recall
public void recall(long delayTime) 等待指定时间后撤回这条消息
此方法执行异步(Async)任务- Parameters:
delayTime- 延迟时间(毫秒)
-
getQuoteReplySenderID
public long getQuoteReplySenderID()返回被回复的消息的发送者- Returns:
- QQ号
-
getQuoteReplyMessage
返回被回复的消息内容转换到字符串的结果,如果不存在回复消息,返回null
此方法使用 contentToString()
QQ 对话框中以纯文本方式会显示的消息内容,这适用于MC与QQ的消息互通等不方便展示原始内容的场景。
无法用纯文字表示的消息会丢失信息,如任何图片都是 [图片]- Returns:
- 被回复的转换字符串后的消息内容
-
getQuoteReplyMessageToString
返回被回复的消息内容转换到字符串的结果,如果不存在回复消息,返回null
此方法使用 toString()
Java 对象的 toString(),会尽可能包含多的信息用于调试作用,行为可能不确定
如需处理常规消息内容,请使用getQuoteReplyMessage()- Returns:
- 原始消息内容
-
getQuoteReplyMessageContent
返回被回复的消息内容转换到字符串的结果,如果不存在回复消息,返回null
此方法使用 contentToString()
QQ 对话框中以纯文本方式会显示的消息内容,这适用于MC与QQ的消息互通等不方便展示原始内容的场景。
无法用纯文字表示的消息会丢失信息,如任何图片都是 [图片]- Returns:
- 被回复的转换字符串后的消息内容
- See Also:
-
getQuoteReplyMessageToMiraiCode
返回被回复的消息内容转换到字符串的结果,如果不存在回复消息,返回null
此方法使用 serializeToMiraiCode()
转换为对应的 Mirai 码,消息的一种序列化方式- Returns:
- 带Mirai Code的消息内容
-
cause
@NotNull public @NotNull org.spongepowered.api.event.Cause cause()
-