pub struct GuildChannelManager<'a, B: Backend> { /* private fields */ }Expand description
The channels of one guild, as a whole (D-234). Returned by Context::guild_channels.
Operations on one channel by its ID (fetch, edit, delete, permission overwrites) are on
Context::channels. The cached channels of a guild are listed by
CacheView::in_guild on ctx.channels().cache().
discord.js counterpart: GuildChannelManager (guild.channels).
Implementations§
Source§impl<'a, B: Backend> GuildChannelManager<'a, B>
impl<'a, B: Backend> GuildChannelManager<'a, B>
Sourcepub const fn guild_id(self) -> GuildId
pub const fn guild_id(self) -> GuildId
The guild these channels belong to.
discord.js counterpart: GuildChannelManager#guild.
Sourcepub async fn list(self) -> Result<Collection<ChannelId, Arc<Channel>>, Error>
pub async fn list(self) -> Result<Collection<ChannelId, Arc<Channel>>, Error>
Every channel of the guild except threads, in Discord’s order (Get Guild Channels); the channels are cached.
discord.js counterpart: GuildChannelManager#fetch().
§Errors
Returns the REST error if the request failed.
Sourcepub async fn create(
self,
body: &CreateGuildChannel,
reason: Option<&str>,
) -> Result<Arc<Channel>, Error>
pub async fn create( self, body: &CreateGuildChannel, reason: Option<&str>, ) -> Result<Arc<Channel>, Error>
Creates a channel (Create Guild Channel); it is cached.
discord.js counterpart: GuildChannelManager#create.
§Errors
Returns the REST error if the request failed (it needs MANAGE_CHANNELS).
Sourcepub async fn set_positions(
self,
positions: &[ModifyGuildChannelPosition],
reason: Option<&str>,
) -> Result<(), Error>
pub async fn set_positions( self, positions: &[ModifyGuildChannelPosition], reason: Option<&str>, ) -> Result<(), Error>
Moves channels (Modify Guild Channel
Positions); the cache follows the
CHANNEL_UPDATE events Discord sends.
discord.js counterpart: GuildChannelManager#setPositions.
§Errors
Returns the REST error if the request failed (it needs MANAGE_CHANNELS).
Sourcepub async fn list_active_threads(self) -> Result<FetchedThreads, Error>
pub async fn list_active_threads(self) -> Result<FetchedThreads, Error>
The guild’s active threads, with the bot’s memberships (List Active Guild Threads); the threads are cached.
discord.js counterpart: GuildChannelManager#fetchActiveThreads.
§Errors
Returns the REST error if the request failed.
Trait Implementations§
Source§impl<B: Backend> Clone for GuildChannelManager<'_, B>
impl<B: Backend> Clone for GuildChannelManager<'_, B>
impl<B: Backend> Copy for GuildChannelManager<'_, B>
Auto Trait Implementations§
impl<'a, B> !RefUnwindSafe for GuildChannelManager<'a, B>
impl<'a, B> !UnwindSafe for GuildChannelManager<'a, B>
impl<'a, B> Freeze for GuildChannelManager<'a, B>
impl<'a, B> Send for GuildChannelManager<'a, B>
impl<'a, B> Sync for GuildChannelManager<'a, B>
impl<'a, B> Unpin for GuildChannelManager<'a, B>
impl<'a, B> UnsafeUnpin for GuildChannelManager<'a, B>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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