16#ifndef MIRAI_FORWARD_MESSAGE_NODE_HPP_
17#define MIRAI_FORWARD_MESSAGE_NODE_HPP_
56 std::optional<MessageRef>
ref_ = std::nullopt;
76 bool hasMessageId()
const {
return this->MessageId_.has_value() || this->ref_.has_value(); }
81 return this->ref_ ? this->ref_->MessageId : this->
MessageId_;
105 this->MessageId_ = std::nullopt;
112 this->MessageId_ = std::nullopt;
113 this->
message_ = std::move(message);
119 this->MessageId_ = MessageId;
125 this->ref_ =
MessageRef{MessageId, (int64_t)target};
Node & SetSenderName(const std::string &SenderName)
设置发送者名称
Node & SetMessageChain(const MessageChain &message)
设置消息内容
std::optional< MessageId_t > GetMessageId() const
获取消息id
std::time_t GetTimestamp() const
获取发送时间
bool hasMessageId() const
是否含有消息id
MessageChain GetMessageChain() const
获取消息链
Node & SetMessageRef(MessageId_t MessageId, UID_t target)
设置消息来源,需要指定消息上下文
Node & SetSenderId(QQ_t SenderId)
设置发送者
std::string GetSenderName() const
获取发送者名称
Node & SetMessageChain(MessageChain &&message)
设置消息内容
Node & SetMessageId(MessageId_t MessageId)
设置消息id,限定为当前会话内的消息
std::optional< MessageId_t > MessageId_
std::optional< MessageRef > ref_
Node & SetTimestamp(std::time_t time)
设置发送时间戳
QQ_t GetSenderId() const
获取发送者QQ
bool valid() const
检查消息链是否有效
Base class for QQ_t and GID_t
int64_t MessageId_t
消息id类型,用于撤回消息和引用消息