Merge branch 'master' into chat_member_methods

This commit is contained in:
Waffle Lapkin 2021-03-30 16:26:46 +03:00 committed by GitHub
commit ccdcda68d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 2 deletions

View file

@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [unreleased]
### Added
- `impl Clone` for {`CacheMe`, `DefaultParseMode`, `Throttle`} ([#75][pr75])
[pr75]: https://github.com/teloxide/teloxide-core/pull/75
### Changed
- Refactor `ChatMember` methods ([#74][pr74])
@ -18,12 +24,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- `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])
- Type of `{Restricted,Kicked}::until_date` fields: `i32` => `i64` ([#74][pr74])
[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
## [0.2.2] - 2020-03-22

View file

@ -18,6 +18,7 @@ use crate::{
///
/// Bot's user is hardly ever changed, so sometimes it's reasonable to cache
/// response from `get_me` method.
#[derive(Clone)]
pub struct CacheMe<B> {
bot: B,
me: Arc<OnceCell<Me>>,

View file

@ -6,6 +6,7 @@ use crate::{
/// Default parse mode adaptor, see
/// [`RequesterExt::parse_mode`](crate::requests::RequesterExt::parse_mode).
#[derive(Clone)]
pub struct DefaultParseMode<B> {
bot: B,
mode: ParseMode,

View file

@ -146,6 +146,7 @@ impl Default for Limits {
///
/// As such, we encourage not to use `ChatId::ChannelUsername(u)` with this bot
/// wrapper.
#[derive(Clone)]
pub struct Throttle<B> {
bot: B,
// `RequestLock` allows to unlock requests (allowing them to be sent).

View file

@ -8,7 +8,7 @@
// [`schema`]: https://github.com/WaffleLapkin/tg-methods-schema
use serde::Serialize;
use crate::types::{ChatAction, ChatId, Message};
use crate::types::{ChatAction, ChatId, True};
impl_payload! {
/// Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.
@ -19,7 +19,7 @@ impl_payload! {
///
/// [ImageBot]: https://t.me/imagebot
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
pub SendChatAction (SendChatActionSetters) => Message {
pub SendChatAction (SendChatActionSetters) => True {
required {
/// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
pub chat_id: ChatId [into],