16#ifndef MIRAI_TYPES_MEDIA_TYPES_HPP_
17#define MIRAI_TYPES_MEDIA_TYPES_HPP_
84 std::unique_ptr<GroupFileInfo>
parent;
91 std::optional<FileInfo>
file = std::nullopt;
147 std::string
GetPath()
const {
return this->isPath_ ? this->
dir_ :
""; }
155 std::string
GetId()
const {
return this->isPath_ ?
"" : this->
dir_; }
165 this->isPath_ =
true;
178 this->isPath_ =
false;
235 return !(this->
id.empty() && this->url.empty() && this->path.empty() && this->base64.empty());
282 return !(this->
id.empty() && this->url.empty() && this->path.empty() && this->base64.empty());
FilePath & SetPath(const std::string &path)
设置文件名路径
FilePath(std::string dir, bool isPath=false)
构造函数
bool isPath() const
判定是否为文件名路径
std::string GetId() const
获取文件id
FilePath & SetId(const std::string &id)
设置文件id
FilePath(const GroupFileInfo &file)
构造函数
std::string GetPath() const
获取文件名路径
std::time_t UploadTime
文件上传时间
std::time_t LastModifyTime
文件修改时间
std::optional< std::string > DownloadUrl
文件下载链接
std::unique_ptr< GroupFileInfo > parent
文件父目录
std::optional< FileInfo > file
文件信息
MiraiAudio(std::string id={}, std::string url={}, std::string path={}, std::string base64={})
std::string base64
音频base64编码
bool valid() const
检查对象能否用于发送
std::string id
音频id,从mirai获得
std::string id
图片id,从mirai获得
std::string base64
图片base64编码
bool valid() const
检查对象能否用于发送
std::string ImageType
图片类型(JPEG,PNG,……)
MiraiImage(std::string id={}, std::string url={}, std::string path={}, std::string base64={})