Struct serenity::model::id::ChannelId

source ·
#[repr(packed(1))]
pub struct ChannelId(/* private fields */);
Expand description

An identifier for a Channel

Implementations§

source§

impl ChannelId

source

pub async fn broadcast_typing(self, http: impl AsRef<Http>) -> Result<()>

Available on crate feature model only.

Broadcasts that the current user is typing to a channel for the next 5 seconds.

After 5 seconds, another request must be made to continue broadcasting that the current user is typing.

This should rarely be used for bots, and should likely only be used for signifying that a long-running command is still being executed.

Note: Requires the Send Messages permission.

§Examples
use serenity::model::id::ChannelId;

let _successful = ChannelId::new(7).broadcast_typing(&http).await;
§Errors

Returns Error::Http if the current user lacks permission to send messages to this channel.

source

pub async fn create_invite( self, cache_http: impl CacheHttp, builder: CreateInvite<'_> ) -> Result<RichInvite>

Available on crate feature model only.

Creates an invite for the given channel.

Note: Requires the Create Instant Invite permission.

§Errors

If the cache is enabled, returns ModelError::InvalidPermissions if the current user lacks permission. Otherwise returns Error::Http, as well as if invalid data is given.

source

pub async fn create_permission( self, http: impl AsRef<Http>, target: PermissionOverwrite ) -> Result<()>

Available on crate feature model only.

Creates a permission overwrite for either a single Member or Role within the channel.

Refer to the documentation for GuildChannel::create_permission for more information.

Requires the Manage Channels permission.

§Errors

Returns Error::Http if the current user lacks permission, or if an invalid value is set.

source

pub async fn create_reaction( self, http: impl AsRef<Http>, message_id: impl Into<MessageId>, reaction_type: impl Into<ReactionType> ) -> Result<()>

Available on crate feature model only.

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.

§Errors

Returns Error::Http if the current user lacks permission.

source

pub async fn delete(self, http: impl AsRef<Http>) -> Result<Channel>

Available on crate feature model only.

Deletes this channel, returning the channel on a successful deletion.

Note: Requires the Manage Channels permission.

§Errors

Returns Error::Http if the current user lacks permission.

source

pub async fn delete_message( self, http: impl AsRef<Http>, message_id: impl Into<MessageId> ) -> Result<()>

Available on crate feature model only.

Deletes a Message given its Id.

Refer to Message::delete for more information.

Requires the Manage Messages permission, if the current user is not the author of the message.

§Errors

Returns Error::Http if the current user lacks permission to delete the message.

source

pub async fn delete_messages<T: AsRef<MessageId>>( self, http: impl AsRef<Http>, message_ids: impl IntoIterator<Item = T> ) -> Result<()>

Available on crate feature model only.

Deletes all messages by Ids from the given vector in the given channel.

The minimum amount of messages is 2 and the maximum amount is 100.

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.

Also will return Error::Http if the current user lacks permission to delete messages.

source

pub async fn delete_permission( self, http: impl AsRef<Http>, permission_type: PermissionOverwriteType ) -> Result<()>

Available on crate feature model only.

Deletes all permission overrides in the channel from a member or role.

Note: Requires the Manage Channel permission.

§Errors

Returns Error::Http if the current user lacks permission.

source

pub async fn delete_reaction( self, http: impl AsRef<Http>, message_id: impl Into<MessageId>, user_id: Option<UserId>, reaction_type: impl Into<ReactionType> ) -> Result<()>

Available on crate feature model only.

Deletes the given Reaction from the channel.

Note: Requires the Manage Messages permission, if the current user did not perform the reaction.

§Errors

Returns Error::Http if the current user did not perform the reaction, and lacks permission.

source

pub async fn delete_reactions( self, http: impl AsRef<Http>, message_id: impl Into<MessageId> ) -> Result<()>

Available on crate feature model only.

Deletes all of the Reactions associated with the provided message id.

Note: Requires the Manage Messages permission.

§Errors

Returns Error::Http if the current user lacks permission

source

pub async fn delete_reaction_emoji( self, http: impl AsRef<Http>, message_id: impl Into<MessageId>, reaction_type: impl Into<ReactionType> ) -> Result<()>

Available on crate feature model only.

Deletes all Reactions of the given emoji to a message within the channel.

Note: Requires the Manage Messages permission.

§Errors

Returns Error::Http if the current user lacks permission.

source

pub async fn edit( self, cache_http: impl CacheHttp, builder: EditChannel<'_> ) -> Result<GuildChannel>

Available on crate feature model only.

Edits a channel’s settings.

Refer to the documentation for EditChannel for a full list of methods.

Note: Requires the Manage Channels permission. Modifying permissions via EditChannel::permissions also requires the Manage Roles permission.

§Examples

Change a voice channel’s name and bitrate:

let builder = EditChannel::new().name("test").bitrate(64000);
channel_id.edit(&http, builder).await;
§Errors

If the cache is enabled, returns a ModelError::InvalidPermissions if the current user lacks permission. Otherwise returns Error::Http, as well as if invalid data is given.

source

pub async fn edit_message( self, cache_http: impl CacheHttp, message_id: impl Into<MessageId>, builder: EditMessage ) -> Result<Message>

Available on crate feature model only.

Edits a Message in the channel given its Id.

Message editing preserves all unchanged message data, with some exceptions for embeds and attachments.

Note: In most cases requires that the current user be the author of the message.

Refer to the documentation for EditMessage for information regarding content restrictions and requirements.

§Errors

See EditMessage::execute for a list of possible errors, and their corresponding reasons.

source

pub async fn follow( self, http: impl AsRef<Http>, target_channel_id: impl Into<ChannelId> ) -> Result<FollowedChannel>

Available on crate feature model only.

Follows the News Channel

Requires [Manage Webhook] permissions on the target channel.

Note: Only available on news channels.

§Errors

Returns Error::Http if the current user lacks permission. [Manage Webhook]: Permissions::MANAGE_WEBHOOKS

source

pub fn to_channel_cached(self, cache: &Cache) -> Option<GuildChannelRef<'_>>

👎Deprecated: Use Cache::guild and Guild::channels instead
Available on crate features model and cache only.

Attempts to find a GuildChannel by its Id in the cache.

source

pub async fn to_channel(self, cache_http: impl CacheHttp) -> Result<Channel>

Available on crate feature model only.

First attempts to retrieve the channel from the temp_cache if enabled, otherwise performs a HTTP request.

It is recommended to first check if the channel is accessible via Cache::guild and Guild::members, although this requires a GuildId.

§Errors

Returns Error::Http if the channel retrieval request failed.

source

pub async fn invites(self, http: impl AsRef<Http>) -> Result<Vec<RichInvite>>

Available on crate feature model only.

Gets all of the channel’s invites.

Requires the Manage Channels permission.

§Errors

Returns Error::Http if the current user lacks permission.

source

pub async fn message( self, cache_http: impl CacheHttp, message_id: impl Into<MessageId> ) -> Result<Message>

Available on crate feature model only.

Gets a message from the channel.

If the cache feature is enabled the cache will be checked first. If not found it will resort to an http request.

Requires the Read Message History permission.

§Errors

Returns Error::Http if the current user lacks permission.

source

pub async fn messages( self, cache_http: impl CacheHttp, builder: GetMessages ) -> Result<Vec<Message>>

Available on crate feature model only.

Gets messages from the channel.

Note: If the user does not have the Read Message History permission, returns an empty Vec.

§Errors

Returns Error::Http if the current user lacks permission.

source

pub fn messages_iter<H: AsRef<Http>>( self, http: H ) -> impl Stream<Item = Result<Message>>

Available on crate feature model only.

Streams over all the messages in a channel.

This is accomplished and equivalent to repeated calls to Self::messages. A buffer of at most 100 messages is used to reduce the number of calls. necessary.

The stream returns the newest message first, followed by older messages.

§Examples
use serenity::futures::StreamExt;
use serenity::model::channel::MessagesIter;

let mut messages = channel_id.messages_iter(&ctx).boxed();
while let Some(message_result) = messages.next().await {
    match message_result {
        Ok(message) => println!("{} said \"{}\".", message.author.name, message.content,),
        Err(error) => eprintln!("Uh oh! Error: {}", error),
    }
}
source

pub async fn name(self, cache_http: impl CacheHttp) -> Result<String>

Available on crate feature model only.

Returns the name of whatever channel this id holds.

DM channels don’t have a name, so a name is generated according to PrivateChannel::name().

§Errors

Same as Self::to_channel().

source

pub async fn pin( self, http: impl AsRef<Http>, message_id: impl Into<MessageId> ) -> Result<()>

Available on crate feature model only.

Pins a Message to the channel.

Note: Requires the Manage Messages permission.

§Errors

Returns Error::Http if the current user lacks permission, or if the channel has too many pinned messages.

source

pub async fn crosspost( self, http: impl AsRef<Http>, message_id: impl Into<MessageId> ) -> Result<Message>

Available on crate feature model only.

Crossposts a Message.

Requires either to be the message author or to have manage Manage Messages permissions on this channel.

Note: Only available on news channels.

§Errors

Returns Error::Http if the current user lacks permission, and if the user is not the author of the message.

source

pub async fn pins(self, http: impl AsRef<Http>) -> Result<Vec<Message>>

Available on crate feature model only.

Gets the list of Messages which are pinned to the channel.

Note: Returns an empty Vec if the current user does not have the Read Message History permission.

§Errors

Returns Error::Http if the current user lacks permission to view the channel.

source

pub async fn reaction_users( self, http: impl AsRef<Http>, message_id: impl Into<MessageId>, reaction_type: impl Into<ReactionType>, limit: Option<u8>, after: impl Into<Option<UserId>> ) -> Result<Vec<User>>

Available on crate feature model only.

Gets the list of Users who have reacted to a Message with a certain Emoji.

The default limit is 50 - specify otherwise to receive a different maximum number of users. The maximum that may be retrieve at a time is 100, if a greater number is provided then it is automatically reduced.

The optional after attribute is to retrieve the users after a certain user. This is useful for pagination.

Note: Requires the Read Message History permission.

Note: If the passed reaction_type is a custom guild emoji, it must contain the name. So, Emoji or EmojiIdentifier will always work, ReactionType only if ReactionType::Custom::name is Some, and EmojiId will never work.

§Errors

Returns Error::Http if the current user lacks permission to read messages in the channel.

source

pub async fn say( self, cache_http: impl CacheHttp, content: impl Into<String> ) -> Result<Message>

Available on crate feature model only.

Sends a message with just the given message content in the channel.

Note: Message content must be under 2000 unicode code points.

§Errors

Returns a ModelError::MessageTooLong if the content length is over the above limit. See CreateMessage::execute for more details.

source

pub async fn send_files( self, cache_http: impl CacheHttp, files: impl IntoIterator<Item = CreateAttachment>, builder: CreateMessage ) -> Result<Message>

Available on crate feature model only.

Sends file(s) along with optional message contents. The filename must be specified.

Message contents may be passed using the builder argument.

Refer to the documentation for CreateMessage for information regarding content restrictions and requirements.

§Examples

Send files with the paths /path/to/file.jpg and /path/to/file2.jpg:

use serenity::builder::{CreateAttachment, CreateMessage};
use serenity::model::id::ChannelId;

let channel_id = ChannelId::new(7);

let paths = [
    CreateAttachment::path("/path/to/file.jpg").await?,
    CreateAttachment::path("path/to/file2.jpg").await?,
];

let builder = CreateMessage::new().content("some files");
channel_id.send_files(&http, paths, builder).await?;

Send files using File:

use serenity::builder::{CreateAttachment, CreateMessage};
use serenity::model::id::ChannelId;
use tokio::fs::File;

let channel_id = ChannelId::new(7);

let f1 = File::open("my_file.jpg").await?;
let f2 = File::open("my_file2.jpg").await?;

let files = [
    CreateAttachment::file(&f1, "my_file.jpg").await?,
    CreateAttachment::file(&f2, "my_file2.jpg").await?,
];

let builder = CreateMessage::new().content("some files");
let _ = channel_id.send_files(&http, files, builder).await;
§Errors

See CreateMessage::execute for a list of possible errors, and their corresponding reasons.

source

pub async fn send_message( self, cache_http: impl CacheHttp, builder: CreateMessage ) -> Result<Message>

Available on crate feature model only.

Sends a message to the channel.

Refer to the documentation for CreateMessage for information regarding content restrictions and requirements.

§Errors

See CreateMessage::execute for a list of possible errors, and their corresponding reasons.

source

pub fn start_typing(self, http: &Arc<Http>) -> Typing

Available on crate feature model only.

Starts typing in the channel for an indefinite period of time.

Returns Typing that is used to trigger the typing. Typing::stop must be called on the returned struct to stop typing. Note that on some clients, typing may persist for a few seconds after Typing::stop is called. Typing is also stopped when the struct is dropped.

If a message is sent while typing is triggered, the user will stop typing for a brief period of time and then resume again until either Typing::stop is called or the struct is dropped.

This should rarely be used for bots, although it is a good indicator that a long-running command is still being processed.

§Examples
// Initiate typing (assuming http is `Arc<Http>`)
let typing = ChannelId::new(7).start_typing(&http);

// Run some long-running process
long_process();

// Stop typing
typing.stop();
§Errors

Returns Error::Http if the current user lacks permission to send messages in this channel.

source

pub async fn unpin( self, http: impl AsRef<Http>, message_id: impl Into<MessageId> ) -> Result<()>

Available on crate feature model only.

Unpins a Message in the channel given by its Id.

Requires the Manage Messages permission.

§Errors

Returns Error::Http if the current user lacks permission.

source

pub async fn webhooks(self, http: impl AsRef<Http>) -> Result<Vec<Webhook>>

Available on crate feature model only.

Retrieves the channel’s webhooks.

Note: Requires the Manage Webhooks permission.

§Errors

Returns Error::Http if the current user lacks permission.

source

pub async fn create_webhook( self, cache_http: impl CacheHttp, builder: CreateWebhook<'_> ) -> Result<Webhook>

Available on crate feature model only.

Creates a webhook in the channel.

§Errors

See CreateWebhook::execute for a detailed list of possible errors.

source

pub fn await_reply( self, shard_messenger: impl AsRef<ShardMessenger> ) -> MessageCollector

Available on crate features model and collector only.

Returns a builder which can be awaited to obtain a message or stream of messages in this channel.

source

pub fn await_replies( &self, shard_messenger: impl AsRef<ShardMessenger> ) -> MessageCollector

Available on crate features model and collector only.
source

pub fn await_reaction( self, shard_messenger: impl AsRef<ShardMessenger> ) -> ReactionCollector

Available on crate features model and collector only.

Returns a builder which can be awaited to obtain a reaction or stream of reactions sent in this channel.

source

pub fn await_reactions( &self, shard_messenger: impl AsRef<ShardMessenger> ) -> ReactionCollector

Available on crate features model and collector only.
source

pub async fn get_stage_instance( self, http: impl AsRef<Http> ) -> Result<StageInstance>

Available on crate feature model only.

Gets a stage instance.

§Errors

Returns Error::Http if the channel is not a stage channel, or if there is no stage instance currently.

source

pub async fn create_stage_instance( self, cache_http: impl CacheHttp, builder: CreateStageInstance<'_> ) -> Result<StageInstance>

Available on crate feature model only.

Creates a stage instance.

§Errors

Returns Error::Http if there is already a stage instance currently.

source

pub async fn edit_stage_instance( self, cache_http: impl CacheHttp, builder: EditStageInstance<'_> ) -> Result<StageInstance>

Available on crate feature model only.

Edits the stage instance

§Errors

Returns ModelError::InvalidChannelType if the channel is not a stage channel.

Returns Error::Http if the channel is not a stage channel, or there is no stage instance currently.

source

pub async fn edit_thread( self, cache_http: impl CacheHttp, builder: EditThread<'_> ) -> Result<GuildChannel>

Available on crate feature model only.

Edits a thread.

§Errors

Returns Error::Http if the current user lacks permission.

source

pub async fn delete_stage_instance(self, http: impl AsRef<Http>) -> Result<()>

Available on crate feature model only.

Deletes a stage instance.

§Errors

Returns Error::Http if the channel is not a stage channel, or if there is no stage instance currently.

source

pub async fn create_thread_from_message( self, cache_http: impl CacheHttp, message_id: impl Into<MessageId>, builder: CreateThread<'_> ) -> Result<GuildChannel>

Available on crate feature model only.

Creates a public thread that is connected to a message.

§Errors

Returns Error::Http if the current user lacks permission, or if invalid data is given.

source

pub async fn create_thread( self, cache_http: impl CacheHttp, builder: CreateThread<'_> ) -> Result<GuildChannel>

Available on crate feature model only.

Creates a thread that is not connected to a message.

§Errors

Returns Error::Http if the current user lacks permission, or if invalid data is given.

source

pub async fn create_forum_post( self, cache_http: impl CacheHttp, builder: CreateForumPost<'_> ) -> Result<GuildChannel>

Available on crate feature model only.

Creates a post in a forum channel.

§Errors

Returns Error::Http if the current user lacks permission, or if invalid data is given.

source

pub async fn get_thread_members( self, http: impl AsRef<Http> ) -> Result<Vec<ThreadMember>>

Available on crate feature model only.

Gets the thread members, if this channel is a thread.

§Errors

It may return an Error::Http if the channel is not a thread channel

source

pub async fn join_thread(self, http: impl AsRef<Http>) -> Result<()>

Available on crate feature model only.

Joins the thread, if this channel is a thread.

§Errors

It may return an Error::Http if the channel is not a thread channel

source

pub async fn leave_thread(self, http: impl AsRef<Http>) -> Result<()>

Available on crate feature model only.

Leaves the thread, if this channel is a thread.

§Errors

It may return an Error::Http if the channel is not a thread channel

source

pub async fn add_thread_member( self, http: impl AsRef<Http>, user_id: UserId ) -> Result<()>

Available on crate feature model only.

Adds a thread member, if this channel is a thread.

§Errors

It may return an Error::Http if the channel is not a thread channel

source

pub async fn remove_thread_member( self, http: impl AsRef<Http>, user_id: UserId ) -> Result<()>

Available on crate feature model only.

Removes a thread member, if this channel is a thread.

§Errors

It may return an Error::Http if the channel is not a thread channel

source

pub async fn get_thread_member( self, http: impl AsRef<Http>, user_id: UserId, with_member: bool ) -> Result<ThreadMember>

Available on crate feature model only.

Gets a thread member, if this channel is a thread.

with_member controls if ThreadMember::member should be Some

§Errors

It may return an Error::Http if the channel is not a thread channel

source

pub async fn get_archived_private_threads( self, http: impl AsRef<Http>, before: Option<u64>, limit: Option<u64> ) -> Result<ThreadsData>

Available on crate feature model only.

Gets private archived threads of a channel.

§Errors

It may return an Error::Http if the bot doesn’t have the permission to get it.

source

pub async fn get_archived_public_threads( self, http: impl AsRef<Http>, before: Option<u64>, limit: Option<u64> ) -> Result<ThreadsData>

Available on crate feature model only.

Gets public archived threads of a channel.

§Errors

It may return an Error::Http if the bot doesn’t have the permission to get it.

source

pub async fn get_joined_archived_private_threads( self, http: impl AsRef<Http>, before: Option<u64>, limit: Option<u64> ) -> Result<ThreadsData>

Available on crate feature model only.

Gets private archived threads joined by the current user of a channel.

§Errors

It may return an Error::Http if the bot doesn’t have the permission to get it.

source

pub async fn get_poll_answer_voters( self, http: impl AsRef<Http>, message_id: MessageId, answer_id: AnswerId, after: Option<UserId>, limit: Option<u8> ) -> Result<Vec<User>>

Available on crate feature model only.

Get a list of users that voted for this specific answer.

§Errors

If the message does not have a poll.

source

pub async fn end_poll( self, http: impl AsRef<Http>, message_id: MessageId ) -> Result<Message>

Available on crate feature model only.

Ends the Poll on a given MessageId, if there is one.

§Errors

If the message does not have a poll, or if the poll was not created by the current user.

source§

impl ChannelId

source

pub const fn new(id: u64) -> Self

Creates a new ChannelId from a u64.

§Panics

Panics if id is zero.

source

pub const fn get(self) -> u64

Retrieves the inner id as a u64.

source

pub fn created_at(&self) -> Timestamp

Retrieves the time that the ChannelId was created.

Trait Implementations§

source§

impl AsRef<ChannelId> for ChannelId

source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for ChannelId

source§

fn clone(&self) -> ChannelId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ChannelId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ChannelId

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for ChannelId

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for ChannelId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> From<&'a Channel> for ChannelId

Available on crate feature model only.
source§

fn from(channel: &Channel) -> ChannelId

Gets the Id of a Channel.

source§

impl<'a> From<&'a ChannelId> for ChannelId

source§

fn from(id: &'a ChannelId) -> ChannelId

Converts to this type from the input type.
source§

impl<'a> From<&'a GuildChannel> for ChannelId

source§

fn from(public_channel: &GuildChannel) -> ChannelId

Gets the Id of a guild channel.

source§

impl<'a> From<&'a PrivateChannel> for ChannelId

source§

fn from(private_channel: &PrivateChannel) -> ChannelId

Gets the Id of a private channel.

source§

impl<'a> From<&'a WebhookChannel> for ChannelId

source§

fn from(webhook_channel: &WebhookChannel) -> ChannelId

Gets the Id of a webhook channel.

source§

impl From<Channel> for ChannelId

Available on crate feature model only.
source§

fn from(channel: Channel) -> ChannelId

Gets the Id of a Channel.

source§

impl From<ChannelId> for Mention

source§

fn from(value: ChannelId) -> Self

Converts to this type from the input type.
source§

impl From<ChannelId> for NonZeroI64

source§

fn from(id: ChannelId) -> NonZeroI64

Converts to this type from the input type.
source§

impl From<ChannelId> for NonZeroU64

source§

fn from(id: ChannelId) -> NonZeroU64

Converts to this type from the input type.
source§

impl From<ChannelId> for i64

source§

fn from(id: ChannelId) -> i64

Converts to this type from the input type.
source§

impl From<ChannelId> for u64

source§

fn from(id: ChannelId) -> u64

Converts to this type from the input type.
source§

impl From<GuildChannel> for ChannelId

source§

fn from(public_channel: GuildChannel) -> ChannelId

Gets the Id of a guild channel.

source§

impl From<NonZero<u64>> for ChannelId

source§

fn from(id: NonZeroU64) -> ChannelId

Converts to this type from the input type.
source§

impl From<PrivateChannel> for ChannelId

source§

fn from(private_channel: PrivateChannel) -> ChannelId

Gets the Id of a private channel.

source§

impl From<WebhookChannel> for ChannelId

source§

fn from(webhook_channel: WebhookChannel) -> ChannelId

Gets the Id of a webhook channel.

source§

impl From<u64> for ChannelId

source§

fn from(id: u64) -> ChannelId

Converts to this type from the input type.
source§

impl FromStr for ChannelId

§

type Err = <u64 as FromStr>::Err

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for ChannelId

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for ChannelId

source§

fn cmp(&self, other: &ChannelId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<u64> for ChannelId

source§

fn eq(&self, u: &u64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for ChannelId

source§

fn eq(&self, other: &ChannelId) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for ChannelId

source§

fn partial_cmp(&self, other: &ChannelId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for ChannelId

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for ChannelId

source§

impl Eq for ChannelId

source§

impl StructuralPartialEq for ChannelId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> ArgumentConvert for T
where T: FromStr,

§

type Err = <T as FromStr>::Err

Available on crate features utils and client only.
The associated error which can be returned from parsing.
source§

fn convert<'life0, 'async_trait>( __arg0: impl CacheHttp + 'async_trait, __arg1: Option<GuildId>, __arg2: Option<ChannelId>, s: &'life0 str ) -> Pin<Box<dyn Future<Output = Result<T, <T as ArgumentConvert>::Err>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Available on crate features utils and client only.
Parses a string s as a command parameter of this type.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneDebuggableStorage for T

source§

impl<T> CloneableStorage for T
where T: Any + Send + Sync + Clone,

source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Mentionable for T
where T: Into<Mention> + Copy,

source§

fn mention(&self) -> Mention

Creates a Mention that will be able to notify or create a link to the item. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DebuggableStorage for T
where T: Any + Send + Sync + Debug,

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,