#[non_exhaustive]pub struct WebhookGuild {
pub id: GuildId,
pub name: String,
pub icon: Option<ImageHash>,
}
Expand description
The guild object returned by a Webhook
, of type WebhookType::ChannelFollower
.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.id: GuildId
The unique Id identifying the guild.
name: String
The name of the guild.
icon: Option<ImageHash>
The hash of the icon used by the guild.
In the client, this appears on the guild list on the left-hand side.
Implementations§
Source§impl WebhookGuild
impl WebhookGuild
Sourcepub fn to_guild_cached(self, cache: &impl AsRef<Cache>) -> Option<GuildRef<'_>>
pub fn to_guild_cached(self, cache: &impl AsRef<Cache>) -> Option<GuildRef<'_>>
Tries to find the Guild
by its Id in the cache.
Sourcepub async fn to_partial_guild(
self,
cache_http: impl CacheHttp,
) -> Result<PartialGuild>
pub async fn to_partial_guild( self, cache_http: impl CacheHttp, ) -> Result<PartialGuild>
Requests PartialGuild
over REST API.
Note: This will not be a Guild
, as the REST API does not send
all data with a guild retrieval.
§Errors
Returns an Error::Http
if the current user is not in the guild.
Sourcepub async fn to_partial_guild_with_counts(
self,
http: impl AsRef<Http>,
) -> Result<PartialGuild>
pub async fn to_partial_guild_with_counts( self, http: impl AsRef<Http>, ) -> Result<PartialGuild>
Requests PartialGuild
over REST API with counts.
Note: This will not be a Guild
, as the REST API does not send all data with a guild
retrieval.
§Errors
Returns an Error::Http
if the current user is not in the guild.
Trait Implementations§
Source§impl Clone for WebhookGuild
impl Clone for WebhookGuild
Source§fn clone(&self) -> WebhookGuild
fn clone(&self) -> WebhookGuild
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for WebhookGuild
impl Debug for WebhookGuild
Source§impl<'de> Deserialize<'de> for WebhookGuild
impl<'de> Deserialize<'de> for WebhookGuild
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<&WebhookGuild> for GuildId
impl From<&WebhookGuild> for GuildId
Source§fn from(webhook_guild: &WebhookGuild) -> GuildId
fn from(webhook_guild: &WebhookGuild) -> GuildId
Gets the Id of Webhook Guild struct.
Source§impl From<WebhookGuild> for GuildId
impl From<WebhookGuild> for GuildId
Source§fn from(webhook_guild: WebhookGuild) -> GuildId
fn from(webhook_guild: WebhookGuild) -> GuildId
Gets the Id of Webhook Guild struct.