aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/model/id.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/model/id.rs b/src/model/id.rs
index ff236e1..8f925de 100644
--- a/src/model/id.rs
+++ b/src/model/id.rs
@@ -74,6 +74,7 @@ impl From<Emoji> for EmojiId {
}
impl GuildId {
+
/// Search the state for the guild.
#[cfg(feature="methods")]
pub fn find(&self) -> Option<LiveGuild> {
@@ -99,6 +100,13 @@ impl GuildId {
}
}
+ /// Returns this Id as a `ChannelId`, which is useful when needing to use
+ /// the guild Id to send a message to the default channel.
+ #[cfg(feature = "methods")]
+ pub fn to_channel(&self) -> ChannelId {
+ ChannelId(self.0)
+ }
+
/// Retrieves the guild's webhooks.
///
/// **Note**: Requires the [Manage Webhooks] permission.