mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
Merge branch 'master' into private_url
This commit is contained in:
commit
ce1a9ece16
10 changed files with 41 additions and 15 deletions
|
@ -11,9 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
- `impl Clone` for {`CacheMe`, `DefaultParseMode`, `Throttle`} ([#75][pr75])
|
||||
- Getters for fields nested in `Chat` ([#80][pr80])
|
||||
- API errors: `ApiError::NotEnoughRightsToManagePins`, `ApiError::BotKickedFromSupergroup` ([#84][pr84])
|
||||
|
||||
[pr75]: https://github.com/teloxide/teloxide-core/pull/75
|
||||
[pr80]: https://github.com/teloxide/teloxide-core/pull/80
|
||||
[pr84]: https://github.com/teloxide/teloxide-core/pull/84
|
||||
|
||||
### Changed
|
||||
|
||||
|
@ -29,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
- Type of `PublicChatSupergroup::slow_mode_delay` field: `Option<i32>`=> `Option<u32>` ([#80][pr80])
|
||||
- Add missing `Chat::message_auto_delete_time` field ([#80][pr80])
|
||||
- Output types of `LeaveChat` `PinChatMessage`, `SetChatDescription`, `SetChatPhoto` `SetChatTitle`, `UnpinAllChatMessages` and `UnpinChatMessage`: `String` => `True` ([#79][pr79])
|
||||
- `SendChatAction` output type `Message` => `True` ([#75][pr75])
|
||||
- `GetChatAdministrators` output type `ChatMember` => `Vec<ChatMember>` ([#73][pr73])
|
||||
- `reqwest` dependency bringing `native-tls` in even when `rustls` was selected ([#71][pr71])
|
||||
|
@ -37,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
[pr71]: https://github.com/teloxide/teloxide-core/pull/71
|
||||
[pr73]: https://github.com/teloxide/teloxide-core/pull/73
|
||||
[pr75]: https://github.com/teloxide/teloxide-core/pull/75
|
||||
[pr79]: https://github.com/teloxide/teloxide-core/pull/79
|
||||
|
||||
## [0.2.2] - 2020-03-22
|
||||
|
||||
|
|
|
@ -373,6 +373,18 @@ pub enum ApiError {
|
|||
#[serde(rename = "Bad Request: not enough rights to pin a message")]
|
||||
NotEnoughRightsToPinMessage,
|
||||
|
||||
/// Occurs when bot tries to pin or unpin a message without rights to pin
|
||||
/// in this chat.
|
||||
///
|
||||
/// May happen in methods:
|
||||
/// 1. [`PinChatMessage`]
|
||||
/// 2. [`UnpinChatMessage`]
|
||||
///
|
||||
/// [`PinChatMessage`]: crate::payloads::PinChatMessage
|
||||
/// [`UnpinChatMessage`]: crate::payloads::UnpinChatMessage
|
||||
#[serde(rename = "Bad Request: not enough rights to manage pinned messages in the chat")]
|
||||
NotEnoughRightsToManagePins,
|
||||
|
||||
/// Occurs when bot tries to use method in group which is allowed only in a
|
||||
/// supergroup or channel.
|
||||
#[serde(rename = "Bad Request: method is available only for supergroups and channel")]
|
||||
|
@ -475,6 +487,16 @@ pub enum ApiError {
|
|||
#[serde(rename = "Unauthorized: bot was kicked from a chat")]
|
||||
BotKicked,
|
||||
|
||||
/// Occurs when bot tries to do something in a supergroup the bot was
|
||||
/// kicked from.
|
||||
///
|
||||
/// May happen in methods:
|
||||
/// 1. [`SendMessage`]
|
||||
///
|
||||
/// [`SendMessage`]: crate::payloads::SendMessage
|
||||
#[serde(rename = "Forbidden: bot was kicked from the supergroup chat")]
|
||||
BotKickedFromSupergroup,
|
||||
|
||||
/// Occurs when bot tries to send message to deactivated user.
|
||||
///
|
||||
/// May happen in methods:
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
// ```console
|
||||
// $ RUSTDOCFLAGS="--cfg docsrs -Znormalize-docs" cargo doc --open --all-features
|
||||
// ```
|
||||
#![cfg_attr(all(docsrs, feature = "nightly"), feature(doc_cfg, doc_spotlight))]
|
||||
#![cfg_attr(all(docsrs, feature = "nightly"), feature(doc_cfg, doc_notable_trait))]
|
||||
#![cfg_attr(feature = "nightly", feature(min_type_alias_impl_trait))]
|
||||
#![cfg_attr(all(feature = "full", docsrs), deny(rustdoc::broken_intra_doc_links))]
|
||||
//#![deny(missing_docs)]
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
// [`schema`]: https://github.com/WaffleLapkin/tg-methods-schema
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::types::ChatId;
|
||||
use crate::types::{ChatId, True};
|
||||
|
||||
impl_payload! {
|
||||
/// Use this method for your bot to leave a group, supergroup or channel. Returns _True_ on success.
|
||||
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
|
||||
pub LeaveChat (LeaveChatSetters) => String {
|
||||
pub LeaveChat (LeaveChatSetters) => True {
|
||||
required {
|
||||
/// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
|
||||
pub chat_id: ChatId [into],
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
// [`schema`]: https://github.com/WaffleLapkin/tg-methods-schema
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::types::ChatId;
|
||||
use crate::types::{ChatId, True};
|
||||
|
||||
impl_payload! {
|
||||
/// Use this method to pin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel. Returns _True_ on success.
|
||||
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
|
||||
pub PinChatMessage (PinChatMessageSetters) => String {
|
||||
pub PinChatMessage (PinChatMessageSetters) => True {
|
||||
required {
|
||||
/// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
|
||||
pub chat_id: ChatId [into],
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
// [`schema`]: https://github.com/WaffleLapkin/tg-methods-schema
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::types::ChatId;
|
||||
use crate::types::{ChatId, True};
|
||||
|
||||
impl_payload! {
|
||||
/// Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns _True_ on success.
|
||||
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
|
||||
pub SetChatDescription (SetChatDescriptionSetters) => String {
|
||||
pub SetChatDescription (SetChatDescriptionSetters) => True {
|
||||
required {
|
||||
/// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
|
||||
pub chat_id: ChatId [into],
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
// [`schema`]: https://github.com/WaffleLapkin/tg-methods-schema
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::types::{ChatId, InputFile};
|
||||
use crate::types::{ChatId, InputFile, True};
|
||||
|
||||
impl_payload! {
|
||||
@[multipart]
|
||||
/// Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns _True_ on success.
|
||||
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
|
||||
pub SetChatPhoto (SetChatPhotoSetters) => String {
|
||||
pub SetChatPhoto (SetChatPhotoSetters) => True {
|
||||
required {
|
||||
/// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
|
||||
pub chat_id: ChatId [into],
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
// [`schema`]: https://github.com/WaffleLapkin/tg-methods-schema
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::types::ChatId;
|
||||
use crate::types::{ChatId, True};
|
||||
|
||||
impl_payload! {
|
||||
/// Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns _True_ on success.
|
||||
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
|
||||
pub SetChatTitle (SetChatTitleSetters) => String {
|
||||
pub SetChatTitle (SetChatTitleSetters) => True {
|
||||
required {
|
||||
/// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
|
||||
pub chat_id: ChatId [into],
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
// [`schema`]: https://github.com/WaffleLapkin/tg-methods-schema
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::types::ChatId;
|
||||
use crate::types::{ChatId, True};
|
||||
|
||||
impl_payload! {
|
||||
/// Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns _True_ on success.
|
||||
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
|
||||
pub UnpinAllChatMessages (UnpinAllChatMessagesSetters) => String {
|
||||
pub UnpinAllChatMessages (UnpinAllChatMessagesSetters) => True {
|
||||
required {
|
||||
/// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
|
||||
pub chat_id: ChatId [into],
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
// [`schema`]: https://github.com/WaffleLapkin/tg-methods-schema
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::types::ChatId;
|
||||
use crate::types::{ChatId, True};
|
||||
|
||||
impl_payload! {
|
||||
/// Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns _True_ on success.
|
||||
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
|
||||
pub UnpinChatMessage (UnpinChatMessageSetters) => String {
|
||||
pub UnpinChatMessage (UnpinChatMessageSetters) => True {
|
||||
required {
|
||||
/// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
|
||||
pub chat_id: ChatId [into],
|
||||
|
|
Loading…
Add table
Reference in a new issue