Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot API 7.0 #128

Merged
merged 5 commits into from
Jan 6, 2024
Merged

Bot API 7.0 #128

merged 5 commits into from
Jan 6, 2024

Conversation

ayrat555
Copy link
Owner

No description provided.

@ayrat555 ayrat555 requested review from EdJoPaTo and pxp9 December 30, 2023 13:47
Copy link
Collaborator

@EdJoPaTo EdJoPaTo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only looked into the file changes which seem fine and not the documentation. Also haven't tried if they actually work.

@Programistich
Copy link

Idk, but available_reaction return None all direct messages and group (in settings all reactions ON)

@ayrat555
Copy link
Owner Author

ayrat555 commented Jan 1, 2024

@Programistich

it's returned only in getChat.

 Ok(MethodResponse { ok: true, result: Chat { id: -4072265349, type_field: Group, title: Some("test"), username: None, first_name: None, last_name: None, is_forum: None, photo: None, active_usernames: None, available_reactions: Some([Emoji(ReactionTypeEmoji { emoji: "👍" }), Emoji(ReactionTypeEmoji { emoji: "👎" })]), emoji_status_custom_emoji_id: None, emoji_status_expiration_date: None, bio: None, has_private_forwards: None, has_restricted_voice_and_video_messages: None, join_to_send_messages: None, join_by_request: None, description: None, invite_link: Some("https://t.me/+NuBgd-Qu8IFiMjRi"), pinned_message: None, permissions: Some(ChatPermissions { can_send_messages: Some(true), can_send_audios: Some(true), can_send_documents: Some(true), can_send_photos: Some(true), can_send_videos: Some(true), can_send_video_notes: Some(true), can_send_voice_notes: Some(true), can_send_polls: Some(true), can_send_other_messages: Some(true), can_add_web_page_previews: Some(true), can_change_info: Some(true), can_invite_users: Some(true), can_pin_messages: Some(true), can_manage_topics: Some(true) }), slow_mode_delay: None, message_auto_delete_time: None, has_aggressive_anti_spam_enabled: None, has_hidden_members: None, has_protected_content: None, sticker_set_name: None, can_set_sticker_set: None, linked_chat_id: None, location: None }, description: None })

@Programistich
Copy link

Programistich commented Jan 4, 2024

@ayrat555

IDK, but api return in direct message

Ok(MethodResponse { ok: true, result: true, description: None })

send_react(&api, &message, "👍").await;

async fn send_react(api: &AsyncApi, message: &Message, reaction: &str)  {
    let reaction = ReactionTypeEmoji { emoji: String::from(reaction) };
    let reaction_type = ReactionType::Emoji(reaction);

    let send_react_params = SetMessageReactionParams::builder()
        .chat_id(message.chat.id)
        .message_id(message.message_id)
        .reacion(vec![reaction_type])
        .is_big(true)
        .build();

    let result = api.set_message_reaction(&send_react_params).await;
    println!("{:?}", result);
}

But in telegram none reactions and etc


In chats, with same code, i have

Err(Api(ErrorResponse { ok: false, description: "Bad Request: REACTION_EMPTY", error_code: 400, parameters: None }))

image

@ayrat555
Copy link
Owner Author

ayrat555 commented Jan 5, 2024

@Programistich thank you. the bug is found and fixed in this branch

* API 7: replies 2.0

* Bot API 7.0: Link Preview Customization (#130)

* Bot API 7.0: Link Preview Customization

* Bot API 7.0: Multiple Message Actions (#131)

* Bot API 7.0: Multiple Message Actions

* Bot API 7.0: Request for multiple users (#132)

* Bot API 7.0: Request for multiple users

* Bot API 7.0: Chat Boost (#133)

* Bot API 7.0: Chat Boost

* Bot API 7.0: Giveaway (#134)

* Bot API 7.0: Giveaway

* Bot API 7.0: Other changes (#135)
@ayrat555 ayrat555 changed the title Bot API 7.0: Reactions Bot API 7.0 Jan 6, 2024
@ayrat555 ayrat555 merged commit 636ef39 into master Jan 6, 2024
21 checks passed
@ayrat555 ayrat555 deleted the ayrat555/api-7 branch January 6, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants