Remove ChatPermissions::can_send_media_messages instance function

This commit is contained in:
TheAwiteb 2023-09-26 22:04:57 +03:00 committed by Awiteb
parent cd2ef79b0f
commit 803faf07e4
No known key found for this signature in database
GPG key ID: 16C8AD0B49C39C88

View file

@ -74,7 +74,7 @@ bitflags::bitflags! {
const SEND_POLLS = (1 << 7) | Self::SEND_MESSAGES.bits;
/// 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
| Self::SEND_DOCUMENTS.bits
| Self::SEND_PHOTOS.bits
@ -83,7 +83,7 @@ bitflags::bitflags! {
| Self::SEND_VOICE_NOTES.bits;
/// 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
| Self::SEND_DOCUMENTS.bits
| Self::SEND_PHOTOS.bits
@ -115,20 +115,6 @@ impl ChatPermissions {
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.
///
/// [`SEND_AUDIOS`]: ChatPermissions::SEND_AUDIOS