mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Add giveaway*
getters to Message
This commit is contained in:
parent
d9587ea562
commit
fda1890425
1 changed files with 40 additions and 1 deletions
|
@ -692,7 +692,8 @@ mod getters {
|
|||
use super::{
|
||||
MessageForumTopicClosed, MessageForumTopicCreated, MessageForumTopicEdited,
|
||||
MessageForumTopicReopened, MessageGeneralForumTopicHidden,
|
||||
MessageGeneralForumTopicUnhidden, MessageMessageAutoDeleteTimerChanged,
|
||||
MessageGeneralForumTopicUnhidden, MessageGiveaway, MessageGiveawayCompleted,
|
||||
MessageGiveawayCreated, MessageGiveawayWinners, MessageMessageAutoDeleteTimerChanged,
|
||||
MessageVideoChatEnded, MessageVideoChatScheduled, MessageVideoChatStarted,
|
||||
MessageWebAppData, MessageWriteAccessAllowed,
|
||||
};
|
||||
|
@ -1413,6 +1414,44 @@ mod getters {
|
|||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn giveaway(&self) -> Option<&types::Giveaway> {
|
||||
match &self.kind {
|
||||
Giveaway(MessageGiveaway { giveaway }) => Some(giveaway),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn giveaway_completed(&self) -> Option<&types::GiveawayCompleted> {
|
||||
match &self.kind {
|
||||
GiveawayCompleted(MessageGiveawayCompleted { giveaway_completed }) => {
|
||||
Some(giveaway_completed)
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn giveaway_created(&self) -> Option<&types::GiveawayCreated> {
|
||||
match &self.kind {
|
||||
GiveawayCreated(MessageGiveawayCreated { giveaway_created }) => {
|
||||
Some(giveaway_created)
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn giveaway_winners(&self) -> Option<&types::GiveawayWinners> {
|
||||
match &self.kind {
|
||||
GiveawayWinners(MessageGiveawayWinners { giveaway_winners }) => {
|
||||
Some(giveaway_winners)
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn video_chat_scheduled(&self) -> Option<&types::VideoChatScheduled> {
|
||||
match &self.kind {
|
||||
|
|
Loading…
Reference in a new issue