Closed taimast closed 6 months ago
Are you sure the message wasn't sent @via inline
? The library doesn't modify the bot
flag returned by Telegram in any way:
https://github.com/Lonami/grammers/blob/04d95775e01f52e8326e1d1e203ee1b5137ee518/lib/grammers-client/src/types/chat/user.rs#L247-L249
Are you sure the message wasn't sent
@via inline
? The library doesn't modify thebot
flag returned by Telegram in any way:
Of this kind
Can you check what value the min
field has?
Can you check what value the
min
field has?
impl ChatTypeFilter {
pub(crate) async fn handle(&self, context: &ComponentContext<'_>) -> bool {
if self.chat_types.len() == 0 {
return false;
}
ChatTypeForFilter::is_contains(&self.chat_types, &context.message.chat())
}
}
impl ChatTypeForFilter {
pub fn is_contains(array: &Vec<Self>, chat: &Chat) -> bool {
if array.len() == 0 {
return false;
}
return match chat {
Chat::User(user) => {
println!("{}", user.is_bot());
println!("{}", user.min());
if user.is_bot() {
if array.contains(&ChatTypeForFilter::Bot) {
return true;
}
} else {
if array.contains(&ChatTypeForFilter::Private) {
return true;
}
}
false
}
Chat::Group(_) => {
if array.contains(&ChatTypeForFilter::Group) {
return true;
}
false
}
Chat::Channel(_) => {
if array.contains(&ChatTypeForFilter::SuperGroup) {
return true;
}
false
}
};
}
}
false
false
For messages without an attached keyboard that the bot sends, the
Chat::User(user)
type attached to the message has the flaguser.is_bot() == False
, although if the keyboard is attached, thenuser.is_bot() == True