Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken GuildChannel await_reply functionality #1446

Merged
merged 2 commits into from Jul 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/model/channel/guild_channel.rs
Expand Up @@ -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<ShardMessenger>,
) -> 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<ShardMessenger>,
) -> 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<ShardMessenger>,
) -> 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<ShardMessenger>,
) -> 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.
Expand Down
6 changes: 3 additions & 3 deletions src/model/channel/mod.rs
Expand Up @@ -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!"); },
/// }
/// # }
/// ```
Expand Down