Struct ChannelView

Source
pub struct ChannelView {
    pub messages: ChannelMessagesView,
    /* private fields */
}
Expand description

A view for interfacing with a Discord channel.

Fields§

§messages: ChannelMessagesView

A view for interfacing with a channel’s messages.

Implementations§

Source§

impl ChannelView

Source

pub fn create_message<M: MessageResponse>( &self, payload: M, ) -> impl Future<Item = Message, Error = Error>

Creates a message in the current channel. This endpoint requires the Create Messages permission on Discord.

Source

pub fn messages(&self) -> ChannelMessagesView

Returns a view representing the messages in this channel.

Source

pub fn create_invite( &self, inv: CreateInviteOptions, ) -> impl Future<Item = Invite, Error = Error>

Creates an invite for the current channel. Requires the Create Invite permission on Discord.

Source

pub fn edit_overwrite( &self, id: &Snowflake, ) -> impl Future<Item = (), Error = Error>

Edits a permission overwrite for a given channel.

Source

pub fn delete_overwrite( &self, id: &Snowflake, ) -> impl Future<Item = (), Error = Error>

Deletes a permission overwrite for the current channel.

Source

pub fn get_invites(&self) -> impl Future<Item = Vec<Invite>, Error = Error>

Gets a collection of all invites created for this channel.

Source

pub fn get_pins(&self) -> impl Future<Item = Vec<Message>, Error = Error>

Gets a list of all pinned messages in the channel.

Source

pub fn fetch(&self) -> impl Future<Item = Channel, Error = Error>

Fetches a Channel object using the provided ID.

Source

pub fn delete(&self) -> impl Future<Item = Channel, Error = Error>

Deletes this channel from Discord, or in the case of a direct messages, closes the channel.

Source

pub fn delete_pin( &self, mid: &Snowflake, ) -> impl Future<Item = (), Error = Error>

Deletes a pinned message from this channel.

Source

pub fn edit_message( &self, mid: &Snowflake, payload: impl MessageResponse, ) -> impl Future<Item = Message, Error = Error>

Edits the message in this channel, with the given message ID.

Source

pub fn modify( &self, payload: ModifyChannelOptions, ) -> impl Future<Item = Channel, Error = Error>

Modifies this channel.

Source

pub fn trigger_typing(&self) -> impl Future<Item = (), Error = Error>

Triggers the typing indicator, authored by the client user, in the current channel.

Source

pub fn pin_message( &self, mid: &Snowflake, ) -> impl Future<Item = (), Error = Error>

Adds a pinned message to this channel.

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> 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

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>,

Source§

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<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

Source§

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

Source§

impl<T> Erased for T

Source§

impl<T> ErasedDestructor for T
where T: 'static,