mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
Merge pull request #211 from teloxide/r060
Release `teloxide-core` 0.6.0
This commit is contained in:
commit
57122b7533
12 changed files with 46 additions and 39 deletions
15
CHANGELOG.md
15
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<String>` 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<String>` 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
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
</div>
|
||||
|
||||
```toml
|
||||
teloxide-core = "0.5"
|
||||
teloxide-core = "0.6"
|
||||
```
|
||||
_Compiler support: requires rustc 1.58+_.
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
//! asynchronous and built using [`tokio`].
|
||||
//!
|
||||
//!```toml
|
||||
//! teloxide_core = "0.5"
|
||||
//! teloxide_core = "0.6"
|
||||
//! ```
|
||||
//! _Compiler support: requires rustc 1.58+_.
|
||||
//!
|
||||
|
|
|
@ -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,
|
||||
|
|
16
src/types.rs
16
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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {}
|
|
@ -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<Vec<User>>,
|
||||
}
|
|
@ -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<Utc>,
|
|
@ -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 {}
|
Loading…
Reference in a new issue