mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-10-27 04:52:06 +00:00
Every adapter set title (mostly None) on all three Media variants and nothing ever read it: the bot's CachedMedia carries kind/file_id/url, and the one read was misskey's own test. Removing it also drops misskey's DriveFile.name, which existed only to feed it. Fetched::title (the post's own headline, which captions do use) is untouched.
34 lines
951 B
Rust
34 lines
951 B
Rust
use serde::Deserialize;
|
|
|
|
#[derive(Deserialize, Debug)]
|
|
pub(crate) struct Note {
|
|
pub(crate) id: String,
|
|
pub(crate) text: Option<String>,
|
|
#[serde(default)]
|
|
pub(crate) cw: Option<String>,
|
|
pub(crate) user: User,
|
|
#[serde(default)]
|
|
pub(crate) files: Vec<DriveFile>,
|
|
/// Embedded original note when this note is a renote; the shell's own
|
|
/// text/files are usually empty and the content lives here.
|
|
#[serde(default)]
|
|
pub(crate) renote: Option<Box<Note>>,
|
|
}
|
|
|
|
#[derive(Deserialize, Debug)]
|
|
pub(crate) struct User {
|
|
pub(crate) name: Option<String>,
|
|
pub(crate) username: String,
|
|
}
|
|
|
|
#[derive(Deserialize, Debug)]
|
|
pub(crate) struct DriveFile {
|
|
#[serde(rename = "type")]
|
|
pub(crate) mime_type: String,
|
|
pub(crate) url: String,
|
|
#[serde(default, rename = "thumbnailUrl")]
|
|
pub(crate) thumbnail_url: Option<String>,
|
|
#[serde(default, rename = "isSensitive")]
|
|
pub(crate) is_sensitive: bool,
|
|
}
|