mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-25 08:02:06 +01:00
Remove ChatPermissions::can_send_media_messages
instance function
This commit is contained in:
parent
cd2ef79b0f
commit
803faf07e4
1 changed files with 2 additions and 16 deletions
|
@ -74,7 +74,7 @@ bitflags::bitflags! {
|
||||||
const SEND_POLLS = (1 << 7) | Self::SEND_MESSAGES.bits;
|
const SEND_POLLS = (1 << 7) | Self::SEND_MESSAGES.bits;
|
||||||
|
|
||||||
/// Set if the user is allowed to send animations, games, stickers and
|
/// Set if the user is allowed to send animations, games, stickers and
|
||||||
/// use inline bots, implies `SEND_MEDIA_MESSAGES`.
|
/// use inline bots, implies midia messages permissions.
|
||||||
const SEND_OTHER_MESSAGES = (1 << 8) | Self::SEND_AUDIOS.bits
|
const SEND_OTHER_MESSAGES = (1 << 8) | Self::SEND_AUDIOS.bits
|
||||||
| Self::SEND_DOCUMENTS.bits
|
| Self::SEND_DOCUMENTS.bits
|
||||||
| Self::SEND_PHOTOS.bits
|
| Self::SEND_PHOTOS.bits
|
||||||
|
@ -83,7 +83,7 @@ bitflags::bitflags! {
|
||||||
| Self::SEND_VOICE_NOTES.bits;
|
| Self::SEND_VOICE_NOTES.bits;
|
||||||
|
|
||||||
/// Set if the user is allowed to add web page previews to
|
/// Set if the user is allowed to add web page previews to
|
||||||
/// their messages, implies `SEND_MEDIA_MESSAGES`.
|
/// their messages, implies midia messages permissions.
|
||||||
const ADD_WEB_PAGE_PREVIEWS = (1 << 9) | Self::SEND_AUDIOS.bits
|
const ADD_WEB_PAGE_PREVIEWS = (1 << 9) | Self::SEND_AUDIOS.bits
|
||||||
| Self::SEND_DOCUMENTS.bits
|
| Self::SEND_DOCUMENTS.bits
|
||||||
| Self::SEND_PHOTOS.bits
|
| Self::SEND_PHOTOS.bits
|
||||||
|
@ -115,20 +115,6 @@ impl ChatPermissions {
|
||||||
self.contains(ChatPermissions::SEND_MESSAGES)
|
self.contains(ChatPermissions::SEND_MESSAGES)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Checks for [`SEND_MEDIA_MESSAGES`] permission.
|
|
||||||
///
|
|
||||||
/// [`SEND_MEDIA_MESSAGES`]: ChatPermissions::SEND_MEDIA_MESSAGES
|
|
||||||
pub fn can_send_media_messages(&self) -> bool {
|
|
||||||
self.contains(
|
|
||||||
ChatPermissions::SEND_AUDIOS
|
|
||||||
| ChatPermissions::SEND_DOCUMENTS
|
|
||||||
| ChatPermissions::SEND_PHOTOS
|
|
||||||
| ChatPermissions::SEND_VIDEOS
|
|
||||||
| ChatPermissions::SEND_VIDEO_NOTES
|
|
||||||
| ChatPermissions::SEND_VOICE_NOTES,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Checks for [`SEND_AUDIOS`] permission.
|
/// Checks for [`SEND_AUDIOS`] permission.
|
||||||
///
|
///
|
||||||
/// [`SEND_AUDIOS`]: ChatPermissions::SEND_AUDIOS
|
/// [`SEND_AUDIOS`]: ChatPermissions::SEND_AUDIOS
|
||||||
|
|
Loading…
Add table
Reference in a new issue