mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
bool -> Option<bool>
This commit is contained in:
parent
b500296ed6
commit
695ea93e06
1 changed files with 6 additions and 4 deletions
|
@ -13,18 +13,20 @@ pub struct PinChatMessage<'a> {
|
||||||
/// of the target supergroup or channel (in the format @channelusername)
|
/// of the target supergroup or channel (in the format @channelusername)
|
||||||
pub chat_id: ChatId,
|
pub chat_id: ChatId,
|
||||||
pub message_id: i32,
|
pub message_id: i32,
|
||||||
pub disable_notification: bool
|
pub disable_notification: Option<bool>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> PinChatMessage<'a> {
|
impl<'a> PinChatMessage<'a> {
|
||||||
pub(crate) fn new(
|
pub(crate) fn new(
|
||||||
ctx: RequestContext<'a>, chat_id: ChatId, message_id: i32
|
ctx: RequestContext<'a>, chat_id: ChatId, message_id: i32
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self { ctx, chat_id, message_id, disable_notification: false }
|
Self { ctx, chat_id, message_id, disable_notification: None }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn disable_notification(mut self) -> Self {
|
pub fn disable_notification<T>(mut self, val: T) -> Self
|
||||||
self.disable_notification = true;
|
where T: Into<bool>
|
||||||
|
{
|
||||||
|
self.disable_notification = Some(val.into());
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue