update to teloxide 17 and add parameter to enable the manga filter

This commit is contained in:
2025-12-17 01:01:41 +00:00
parent 8ca9c85aa0
commit 9c9624b43c
12 changed files with 1373 additions and 836 deletions

View File

@@ -1,47 +1,45 @@
use chrono::DateTime;
use teloxide::types::{
Chat, ChatId, ChatKind, ChatPublic, MediaKind::Text, MediaText, Message, MessageCommon,
MessageId, MessageKind::Common, PublicChatGroup, PublicChatKind::Group,
MessageId, MessageKind::Common, PublicChatKind::Group,
};
pub fn generate_msg_mock(text: &str) -> Message {
let chat_id = ChatId { 0: 0 };
let public_chat_kind = Group(PublicChatGroup { permissions: None });
let public_chat_kind = Group;
let chat_kind = ChatKind::Public(ChatPublic {
title: None,
kind: public_chat_kind,
description: None,
invite_link: None,
has_protected_content: None,
});
let chat = Chat {
has_aggressive_anti_spam_enabled: false,
has_hidden_members: false,
id: chat_id,
pinned_message: None,
photo: None,
message_auto_delete_time: None,
kind: chat_kind,
};
let media_kind = Text(MediaText {
text: text.to_string(),
entities: Vec::new(),
link_preview_options: None,
});
let message_kind = Common(MessageCommon {
from: None,
sender_chat: None,
author_signature: None,
forward: None,
reply_to_message: None,
edit_date: None,
media_kind,
reply_markup: None,
is_topic_message: false,
is_automatic_forward: false,
has_protected_content: false,
paid_star_count: None,
effect_id: None,
forward_origin: None,
external_reply: None,
quote: None,
reply_to_story: None,
sender_boost_count: None,
business_connection_id: None,
is_from_offline: false,
});
Message {
chat,
@@ -50,5 +48,9 @@ pub fn generate_msg_mock(text: &str) -> Message {
kind: message_kind,
date: DateTime::from_timestamp_nanos(0),
id: MessageId { 0: 0 },
from: None,
is_topic_message: false,
sender_business_bot: None,
sender_chat: None,
}
}