From b9052b5627294c9e24a1fa2d9133a16b74224f78 Mon Sep 17 00:00:00 2001 From: Kot Date: Sun, 25 Jul 2021 19:23:55 -0700 Subject: [PATCH 1/2] Channel.guild example should reflect functionality --- src/model/channel/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/model/channel/mod.rs b/src/model/channel/mod.rs index 74f66330e46..b7cd0c12c9d 100644 --- a/src/model/channel/mod.rs +++ b/src/model/channel/mod.rs @@ -83,10 +83,10 @@ impl Channel { /// # let channel = ChannelId(0).to_channel_cached(&cache).await.unwrap(); /// # /// match channel.guild() { - /// Some(guild) => { - /// println!("It's a guild named {}!", guild.name); + /// Some(guild_channel) => { + /// println!("It's a guild channel named {}!", guild_channel.name); /// }, - /// None => { println!("It's not a guild!"); }, + /// None => { println!("It's not in a guild!"); }, /// } /// # } /// ``` From 40fa1679717f22237921e9376ee95fd1068c9c31 Mon Sep 17 00:00:00 2001 From: Kot Date: Sun, 25 Jul 2021 19:24:07 -0700 Subject: [PATCH 2/2] GuildChannel should await_reply from the channel --- src/model/channel/guild_channel.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/model/channel/guild_channel.rs b/src/model/channel/guild_channel.rs index 8c4a0a88e27..3b3f835e6ed 100644 --- a/src/model/channel/guild_channel.rs +++ b/src/model/channel/guild_channel.rs @@ -1100,44 +1100,44 @@ impl GuildChannel { } } - /// Returns a future that will await one message by this guild. + /// Returns a future that will await one message by this guild channel. #[cfg(feature = "collector")] #[cfg_attr(docsrs, doc(cfg(feature = "collector")))] pub fn await_reply<'a>( &self, shard_messenger: &'a impl AsRef, ) -> CollectReply<'a> { - CollectReply::new(shard_messenger).guild_id(self.id.0) + CollectReply::new(shard_messenger).channel_id(self.id.0) } - /// Returns a stream builder which can be awaited to obtain a stream of messages sent by this guild. + /// Returns a stream builder which can be awaited to obtain a stream of messages sent by this guild channel. #[cfg(feature = "collector")] #[cfg_attr(docsrs, doc(cfg(feature = "collector")))] pub fn await_replies<'a>( &self, shard_messenger: &'a impl AsRef, ) -> MessageCollectorBuilder<'a> { - MessageCollectorBuilder::new(shard_messenger).guild_id(self.id.0) + MessageCollectorBuilder::new(shard_messenger).channel_id(self.id.0) } - /// Await a single reaction by this guild. + /// Await a single reaction by this guild channel. #[cfg(feature = "collector")] #[cfg_attr(docsrs, doc(cfg(feature = "collector")))] pub fn await_reaction<'a>( &self, shard_messenger: &'a impl AsRef, ) -> CollectReaction<'a> { - CollectReaction::new(shard_messenger).guild_id(self.id.0) + CollectReaction::new(shard_messenger).channel_id(self.id.0) } - /// Returns a stream builder which can be awaited to obtain a stream of reactions sent by this guild. + /// Returns a stream builder which can be awaited to obtain a stream of reactions sent by this guild channel. #[cfg(feature = "collector")] #[cfg_attr(docsrs, doc(cfg(feature = "collector")))] pub fn await_reactions<'a>( &self, shard_messenger: &'a impl AsRef, ) -> ReactionCollectorBuilder<'a> { - ReactionCollectorBuilder::new(shard_messenger).guild_id(self.id.0) + ReactionCollectorBuilder::new(shard_messenger).channel_id(self.id.0) } /// Creates a webhook with only a name.