diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a34c9c7..d6d3ce6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,25 +7,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## unreleased +## 0.6.0 - 2022-04-25 + ### Added -- Support for Telegram Bot API [version 6.0](https://core.telegram.org/bots/api#april-16-2022) +- Support for Telegram Bot API [version 6.0](https://core.telegram.org/bots/api#april-16-2022) ([#206][pr206], [#211][pr211]) - Note that some field were renamed - Shortcut methods for `MessageEntity` ([#208][pr208], [#210][pr210]) [pr208]: https://github.com/teloxide/teloxide-core/pull/208 +[pr206]: https://github.com/teloxide/teloxide-core/pull/206 [pr210]: https://github.com/teloxide/teloxide-core/pull/210 +[pr211]: https://github.com/teloxide/teloxide-core/pull/211 ### Changed - - Accept `IntoIterator` in `KeyboardMarkup::append_row`. - - Accept `Into` instead of `String` in `InlineKeyboardButton::{url, callback, switch_inline_query, switch_inline_query_current_chat}`. +- Make `KeyboardMarkup` creation more convenient ([#207][pr207]) + - Accept `IntoIterator` in `KeyboardMarkup::append_row`. + - Accept `Into` instead of `String` in `InlineKeyboardButton::{url, callback, switch_inline_query, switch_inline_query_current_chat}`. + +[pr207]: https://github.com/teloxide/teloxide-core/pull/207 ## 0.5.1 - 2022-04-18 ### Fixed - - Document the `errors` module. +- Document the `errors` module. ## 0.5.0 - 2022-04-13 diff --git a/Cargo.toml b/Cargo.toml index b603cb1d..9435445c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "teloxide-core" description = "Core part of the `teloxide` library - telegram bot API client" -version = "0.5.1" +version = "0.6.0" edition = "2018" license = "MIT" diff --git a/README.md b/README.md index ec1d3296..88420ef0 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ ```toml -teloxide-core = "0.5" +teloxide-core = "0.6" ``` _Compiler support: requires rustc 1.58+_. diff --git a/src/lib.rs b/src/lib.rs index 77239872..da97ab3d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,7 @@ //! asynchronous and built using [`tokio`]. //! //!```toml -//! teloxide_core = "0.5" +//! teloxide_core = "0.6" //! ``` //! _Compiler support: requires rustc 1.58+_. //! diff --git a/src/payloads/promote_chat_member.rs b/src/payloads/promote_chat_member.rs index 30437165..84e56bb6 100644 --- a/src/payloads/promote_chat_member.rs +++ b/src/payloads/promote_chat_member.rs @@ -33,7 +33,7 @@ impl_payload! { pub can_edit_messages: bool, /// Pass True, if the administrator can delete messages of other users pub can_delete_messages: bool, - /// Pass True, if the administrator can manage voice chats, supergroups only + /// Pass True, if the administrator can manage video chats, supergroups only pub can_manage_video_chats: bool, /// Pass True, if the administrator can invite new users to the chat pub can_invite_users: bool, diff --git a/src/types.rs b/src/types.rs index 1551e36f..6f35de8a 100644 --- a/src/types.rs +++ b/src/types.rs @@ -100,12 +100,12 @@ pub use user::*; pub use user_profile_photos::*; pub use venue::*; pub use video::*; +pub use video_chat_ended::*; +pub use video_chat_participants_invited::*; +pub use video_chat_scheduled::*; +pub use video_chat_started::*; pub use video_note::*; pub use voice::*; -pub use voice_chat_ended::*; -pub use voice_chat_participants_invited::*; -pub use voice_chat_scheduled::*; -pub use voice_chat_started::*; pub use web_app_data::*; pub use web_app_info::*; pub use webhook_info::*; @@ -183,12 +183,12 @@ mod user; mod user_profile_photos; mod venue; mod video; +mod video_chat_ended; +mod video_chat_participants_invited; +mod video_chat_scheduled; +mod video_chat_started; mod video_note; mod voice; -mod voice_chat_ended; -mod voice_chat_participants_invited; -mod voice_chat_scheduled; -mod voice_chat_started; mod web_app_data; mod web_app_info; mod webhook_info; diff --git a/src/types/chat_member.rs b/src/types/chat_member.rs index b61c239f..b6e3c824 100644 --- a/src/types/chat_member.rs +++ b/src/types/chat_member.rs @@ -75,7 +75,7 @@ pub struct Administrator { /// `true` if the administrator can delete messages of other users. pub can_delete_messages: bool, - /// `true` if the administrator can manage voice chats. + /// `true` if the administrator can manage video chats. pub can_manage_video_chats: bool, /// `true` if the administrator can invite new users to the chat. @@ -394,15 +394,15 @@ impl ChatMemberKind { } } - /// Returns `true` if the user can manage voice chats. + /// Returns `true` if the user can manage video chats. /// /// I.e. returns `true` if the user /// - is the owner of the chat /// - is an administrator in the given chat and has the - /// [`can_manage_voice_chats`] privilege. + /// [`can_manage_video_chats`] privilege. /// Returns `false` otherwise. /// - /// [`can_manage_voice_chats`]: Administrator::can_manage_voice_chats + /// [`can_manage_video_chats`]: Administrator::can_manage_video_chats pub fn can_manage_video_chats(&self) -> bool { match self { Self::Owner(_) => true, diff --git a/src/types/message.rs b/src/types/message.rs index b0a80500..1765bab9 100644 --- a/src/types/message.rs +++ b/src/types/message.rs @@ -54,10 +54,10 @@ pub enum MessageKind { PassportData(MessagePassportData), Dice(MessageDice), ProximityAlertTriggered(MessageProximityAlertTriggered), - VoiceChatScheduled(MessageVoiceChatScheduled), - VoiceChatStarted(MessageVoiceChatStarted), - VoiceChatEnded(MessageVoiceChatEnded), - VoiceChatParticipantsInvited(MessageVoiceChatParticipantsInvited), + VideoChatScheduled(MessageVideoChatScheduled), + VideoChatStarted(MessageVideoChatStarted), + VideoChatEnded(MessageVideoChatEnded), + VideoChatParticipantsInvited(MessageVideoChatParticipantsInvited), WebAppData(MessageWebAppData), } @@ -493,26 +493,26 @@ pub struct MessageProximityAlertTriggered { } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MessageVoiceChatScheduled { - /// Service message: voice chat scheduled +pub struct MessageVideoChatScheduled { + /// Service message: video chat scheduled pub video_chat_scheduled: VideoChatScheduled, } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MessageVoiceChatStarted { - /// Service message: voice chat started. +pub struct MessageVideoChatStarted { + /// Service message: video chat started. pub video_chat_started: VideoChatStarted, } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MessageVoiceChatEnded { - /// Service message: voice chat ended. +pub struct MessageVideoChatEnded { + /// Service message: video chat ended. pub video_chat_ended: VideoChatEnded, } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct MessageVoiceChatParticipantsInvited { - /// Service message: new participants invited to a voice chat. +pub struct MessageVideoChatParticipantsInvited { + /// Service message: new participants invited to a video chat. pub video_chat_participants_invited: VideoChatParticipantsInvited, } @@ -1466,7 +1466,7 @@ mod tests { let message: Message = serde_json::from_str(json).unwrap(); - assert!(matches!(message.kind, MessageKind::VoiceChatStarted { .. })); + assert!(matches!(message.kind, MessageKind::VideoChatStarted { .. })); // FIXME(waffle): it seems like we are losing `sender_chat` in some // cases inclusing this diff --git a/src/types/voice_chat_ended.rs b/src/types/video_chat_ended.rs similarity index 71% rename from src/types/voice_chat_ended.rs rename to src/types/video_chat_ended.rs index 9a49b763..96775afd 100644 --- a/src/types/voice_chat_ended.rs +++ b/src/types/video_chat_ended.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; -/// This object represents a service message about a voice chat ended in the +/// This object represents a service message about a video chat ended in the /// chat. #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] pub struct VideoChatEnded {} diff --git a/src/types/voice_chat_participants_invited.rs b/src/types/video_chat_participants_invited.rs similarity index 79% rename from src/types/voice_chat_participants_invited.rs rename to src/types/video_chat_participants_invited.rs index 2e1b90a1..1a3f364b 100644 --- a/src/types/voice_chat_participants_invited.rs +++ b/src/types/video_chat_participants_invited.rs @@ -3,9 +3,9 @@ use serde::{Deserialize, Serialize}; use crate::types::User; /// This object represents a service message about new members invited to a -/// voice chat. +/// video chat. #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] pub struct VideoChatParticipantsInvited { - /// New members that were invited to the voice chat + /// New members that were invited to the video chat pub users: Option>, } diff --git a/src/types/voice_chat_scheduled.rs b/src/types/video_chat_scheduled.rs similarity index 72% rename from src/types/voice_chat_scheduled.rs rename to src/types/video_chat_scheduled.rs index a0f26a8a..674b76d4 100644 --- a/src/types/voice_chat_scheduled.rs +++ b/src/types/video_chat_scheduled.rs @@ -1,11 +1,11 @@ use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; -/// This object represents a service message about a voice chat scheduled in the +/// This object represents a service message about a video chat scheduled in the /// chat. #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] pub struct VideoChatScheduled { - /// Point in time when the voice chat is supposed to be started by a chat + /// Point in time when the video chat is supposed to be started by a chat /// administrator. #[serde(with = "crate::types::serde_date_from_unix_timestamp")] pub start_date: DateTime, diff --git a/src/types/voice_chat_started.rs b/src/types/video_chat_started.rs similarity index 75% rename from src/types/voice_chat_started.rs rename to src/types/video_chat_started.rs index 11c9db07..32796c9b 100644 --- a/src/types/voice_chat_started.rs +++ b/src/types/video_chat_started.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; -/// This object represents a service message about a voice chat started in the +/// This object represents a service message about a video chat started in the /// chat. Currently holds no information. #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] pub struct VideoChatStarted {}