mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-11-17 08:22:25 +00:00
refactor(state): add ChatData::format_for for the per-site caption format
Four call sites (cache hit, fresh fetch, startup refetch, /debug preview) spelled out the same message_format.get(...).cloned().unwrap_or_default(); the accessor names the lookup and keeps the empty-format contract in one place.
This commit is contained in:
@@ -626,10 +626,7 @@ pub(crate) async fn execute_command(
|
||||
let format = CHAT_STORE
|
||||
.get(message.chat.id.0)
|
||||
.await
|
||||
.message_format
|
||||
.get(fetched.site_id)
|
||||
.cloned()
|
||||
.unwrap_or_default();
|
||||
.format_for(fetched.site_id);
|
||||
let caption = preview_caption(
|
||||
&format,
|
||||
&fetched.caption,
|
||||
|
||||
Reference in New Issue
Block a user