[−][src]Struct serenity::model::channel::Group
Fields
channel_id: ChannelId
The Id of the group channel.
icon: Option<String>
The optional icon of the group channel.
last_message_id: Option<MessageId>
The Id of the last message sent.
last_pin_timestamp: Option<DateTime<FixedOffset>>
Timestamp of the latest pinned message.
name: Option<String>
The name of the group channel.
owner_id: UserId
The Id of the group owner.
recipients: HashMap<UserId, Arc<RwLock<User>>>
A map of the group's recipients.
Methods
impl Group
[src]
impl Group
pub fn add_recipient<U: Into<UserId>>(&self, user: U) -> Result<()>
[src]
pub fn add_recipient<U: Into<UserId>>(&self, user: U) -> Result<()>
Adds the given user to the group. If the user is already in the group, then nothing is done.
Refer to http::add_group_recipient
for more information.
Note: Groups have a limit of 10 recipients, including the current user.
pub fn broadcast_typing(&self) -> Result<()>
[src]
pub fn broadcast_typing(&self) -> Result<()>
Broadcasts that the current user is typing in the group.
pub fn create_reaction<M, R>(
&self,
message_id: M,
reaction_type: R
) -> Result<()> where
M: Into<MessageId>,
R: Into<ReactionType>,
[src]
pub fn create_reaction<M, R>(
&self,
message_id: M,
reaction_type: R
) -> Result<()> where
M: Into<MessageId>,
R: Into<ReactionType>,
React to a Message
with a custom Emoji
or unicode character.
Message::react
may be a more suited method of reacting in most
cases.
Requires the Add Reactions permission, if the current user is the first user to perform a react with a certain emoji.
pub fn delete_messages<T: AsRef<MessageId>, It: IntoIterator<Item = T>>(
&self,
message_ids: It
) -> Result<()>
[src]
pub fn delete_messages<T: AsRef<MessageId>, It: IntoIterator<Item = T>>(
&self,
message_ids: It
) -> Result<()>
Deletes all messages by Ids from the given vector in the channel.
Refer to Channel::delete_messages
for more information.
Requires the Manage Messages permission.
Note: Messages that are older than 2 weeks can't be deleted using this method.
Errors
Returns ModelError::BulkDeleteAmount
if an attempt was made to
delete either 0 or more than 100 messages.
pub fn delete_permission(
&self,
permission_type: PermissionOverwriteType
) -> Result<()>
[src]
pub fn delete_permission(
&self,
permission_type: PermissionOverwriteType
) -> Result<()>
Deletes all permission overrides in the channel from a member or role.
Note: Requires the Manage Channel permission.
pub fn delete_reaction<M, R>(
&self,
message_id: M,
user_id: Option<UserId>,
reaction_type: R
) -> Result<()> where
M: Into<MessageId>,
R: Into<ReactionType>,
[src]
pub fn delete_reaction<M, R>(
&self,
message_id: M,
user_id: Option<UserId>,
reaction_type: R
) -> Result<()> where
M: Into<MessageId>,
R: Into<ReactionType>,
Deletes the given Reaction
from the channel.
Note: Requires the Manage Messages permission, if the current user did not perform the reaction.
pub fn edit_message<F, M>(&self, message_id: M, f: F) -> Result<Message> where
F: FnOnce(EditMessage) -> EditMessage,
M: Into<MessageId>,
[src]
pub fn edit_message<F, M>(&self, message_id: M, f: F) -> Result<Message> where
F: FnOnce(EditMessage) -> EditMessage,
M: Into<MessageId>,
Edits a Message
in the channel given its Id.
Message editing preserves all unchanged message data.
Refer to the documentation for EditMessage
for more information
regarding message restrictions and requirements.
Note: Requires that the current user be the author of the message.
Errors
Returns a ModelError::MessageTooLong
if the content of the message
is over the the limit
, containing the number of unicode code points
over the limit.
pub fn icon_url(&self) -> Option<String>
[src]
pub fn icon_url(&self) -> Option<String>
Returns the formatted URI of the group's icon if one exists.
pub fn is_nsfw(&self) -> bool
[src]
pub fn is_nsfw(&self) -> bool
Determines if the channel is NSFW.
Note: This method is for consistency. This will always return
false
, due to groups not being considered NSFW.
pub fn leave(&self) -> Result<Group>
[src]
pub fn leave(&self) -> Result<Group>
Leaves the group.
pub fn message<M: Into<MessageId>>(&self, message_id: M) -> Result<Message>
[src]
pub fn message<M: Into<MessageId>>(&self, message_id: M) -> Result<Message>
Gets a message from the channel.
Requires the Read Message History permission.
pub fn messages<F>(&self, f: F) -> Result<Vec<Message>> where
F: FnOnce(GetMessages) -> GetMessages,
[src]
pub fn messages<F>(&self, f: F) -> Result<Vec<Message>> where
F: FnOnce(GetMessages) -> GetMessages,
Gets messages from the channel.
Requires the Read Message History permission.
pub fn name(&self) -> Cow<str>
[src]
pub fn name(&self) -> Cow<str>
Generates a name for the group.
If there are no recipients in the group, the name will be "Empty Group". Otherwise, the name is generated in a Comma Separated Value list, such as "person 1, person 2, person 3".
pub fn pins(&self) -> Result<Vec<Message>>
[src]
pub fn pins(&self) -> Result<Vec<Message>>
Retrieves the list of messages that have been pinned in the group.
pub fn reaction_users<M, R, U>(
&self,
message_id: M,
reaction_type: R,
limit: Option<u8>,
after: U
) -> Result<Vec<User>> where
M: Into<MessageId>,
R: Into<ReactionType>,
U: Into<Option<UserId>>,
[src]
pub fn reaction_users<M, R, U>(
&self,
message_id: M,
reaction_type: R,
limit: Option<u8>,
after: U
) -> Result<Vec<User>> where
M: Into<MessageId>,
R: Into<ReactionType>,
U: Into<Option<UserId>>,
Gets the list of User
s who have reacted to a Message
with a
certain Emoji
.
Refer to Channel::reaction_users
for more information.
Note: Requires the Read Message History permission.
pub fn remove_recipient<U: Into<UserId>>(&self, user: U) -> Result<()>
[src]
pub fn remove_recipient<U: Into<UserId>>(&self, user: U) -> Result<()>
Removes a recipient from the group. If the recipient is already not in the group, then nothing is done.
Note: This is only available to the group owner.
pub fn say(&self, content: &str) -> Result<Message>
[src]
pub fn say(&self, content: &str) -> Result<Message>
Sends a message with just the given message content in the channel.
Errors
Returns a ModelError::MessageTooLong
if the content of the message
is over the above limit, containing the number of unicode code points
over the limit.
pub fn send_files<'a, F, T, It: IntoIterator<Item = T>>(
&self,
files: It,
f: F
) -> Result<Message> where
F: FnOnce(CreateMessage) -> CreateMessage,
T: Into<AttachmentType<'a>>,
[src]
pub fn send_files<'a, F, T, It: IntoIterator<Item = T>>(
&self,
files: It,
f: F
) -> Result<Message> where
F: FnOnce(CreateMessage) -> CreateMessage,
T: Into<AttachmentType<'a>>,
Sends (a) file(s) along with optional message contents.
Refer to ChannelId::send_files
for examples and more information.
The Attach Files and Send Messages permissions are required.
Note: Message contents must be under 2000 unicode code points.
Errors
If the content of the message is over the above limit, then a
ClientError::MessageTooLong
will be returned, containing the number
of unicode code points over the limit.
pub fn send_message<F: FnOnce(CreateMessage) -> CreateMessage>(
&self,
f: F
) -> Result<Message>
[src]
pub fn send_message<F: FnOnce(CreateMessage) -> CreateMessage>(
&self,
f: F
) -> Result<Message>
Sends a message to the group with the given content.
Refer to the documentation for CreateMessage
for more information
regarding message restrictions and requirements.
Note: Requires the Send Messages permission.
pub fn unpin<M: Into<MessageId>>(&self, message_id: M) -> Result<()>
[src]
pub fn unpin<M: Into<MessageId>>(&self, message_id: M) -> Result<()>
Unpins a Message
in the channel given by its Id.
Requires the Manage Messages permission.
Trait Implementations
impl Mentionable for Group
[src]
impl Mentionable for Group
fn mention(&self) -> String
[src]
fn mention(&self) -> String
Creates a mentionable string, that will be able to notify and/or create a link to the item. Read more
impl Clone for Group
[src]
impl Clone for Group
fn clone(&self) -> Group
[src]
fn clone(&self) -> Group
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Group
[src]
impl Debug for Group
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Serialize for Group
[src]
impl Serialize for Group
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for Group
[src]
impl<'de> Deserialize<'de> for Group
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
impl<T> Erased for T
impl<T> Erased for T
impl<T> Typeable for T where
T: Any,
impl<T> Typeable for T where
T: Any,
impl<T> DebugAny for T where
T: Any + Debug,
[src]
impl<T> DebugAny for T where
T: Any + Debug,
impl<T> CloneAny for T where
T: Clone + Any,
[src]
impl<T> CloneAny for T where
T: Clone + Any,
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
[src]
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
[src]
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
[src]
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
[src]
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
impl<T> UnsafeAny for T where
T: Any,
impl<T> UnsafeAny for T where
T: Any,