Struct serenity::builder::EditGuild [−][src]
Expand description
A builder to optionally edit certain fields of a Guild
. This is meant
for usage with Guild::edit
.
Note: Editing a guild requires that the current user have the Manage Guild permission.
Implementations
impl EditGuild
[src]
impl EditGuild
[src]pub fn afk_channel<C: Into<ChannelId>>(
&mut self,
channel: Option<C>
) -> &mut Self
[src]
pub fn afk_channel<C: Into<ChannelId>>(
&mut self,
channel: Option<C>
) -> &mut Self
[src]Set the “AFK voice channel” that users are to move to if they have been
AFK for an amount of time, configurable by Self::afk_timeout
.
The given channel must be either some valid voice channel, or None
to
not set an AFK channel. The library does not check if a channel is
valid.
pub fn afk_timeout(&mut self, timeout: u64) -> &mut Self
[src]
pub fn afk_timeout(&mut self, timeout: u64) -> &mut Self
[src]Set the amount of time a user is to be moved to the AFK channel -
configured via Self::afk_channel
- after being AFK.
pub fn icon(&mut self, icon: Option<&str>) -> &mut Self
[src]
pub fn icon(&mut self, icon: Option<&str>) -> &mut Self
[src]Set the icon of the guild. Pass None
to remove the icon.
Examples
Using the utility function - utils::read_image
- to read an image
from the cwd and encode it in base64 to send to Discord.
use serenity::utils; // assuming a `guild` has already been bound let base64_icon = utils::read_image("./guild_icon.png")?; guild.edit(&http, |mut g| { g.icon(Some(&base64_icon)) }) .await?;
pub fn name<S: ToString>(&mut self, name: S) -> &mut Self
[src]
pub fn name<S: ToString>(&mut self, name: S) -> &mut Self
[src]Set the name of the guild.
Note: Must be between (and including) 2-100 chracters.
pub fn description<S: ToString>(&mut self, name: S) -> &mut Self
[src]
pub fn description<S: ToString>(&mut self, name: S) -> &mut Self
[src]Set the description of the guild.
Note: Requires that the guild have the DISCOVERABLE
feature enabled.
You can check this through a guild’s features
list.
pub fn features(&mut self, features: Vec<String>) -> &mut Self
[src]
pub fn features(&mut self, features: Vec<String>) -> &mut Self
[src]Set the features of the guild.
Note: Requires that the guild have the DISCOVERABLE
feature enabled.
You can check this through a guild’s features
list.
pub fn owner<U: Into<UserId>>(&mut self, user_id: U) -> &mut Self
[src]
pub fn owner<U: Into<UserId>>(&mut self, user_id: U) -> &mut Self
[src]Transfers the ownership of the guild to another user by Id.
Note: The current user must be the owner of the guild.
pub fn region(&mut self, region: Region) -> &mut Self
[src]
👎 Deprecated: Regions are now set per voice channel instead of globally.
pub fn region(&mut self, region: Region) -> &mut Self
[src]Regions are now set per voice channel instead of globally.
Set the voice region of the server.
Examples
Setting the region to Region::UsWest
:
use serenity::model::guild::Region; // assuming a `guild` has already been bound guild.edit(&http, |g| { g.region(Region::UsWest) }) .await?;
pub fn splash(&mut self, splash: Option<&str>) -> &mut Self
[src]
pub fn splash(&mut self, splash: Option<&str>) -> &mut Self
[src]Set the splash image of the guild on the invitation page.
The splash
must be base64-encoded 1024x1024 png/jpeg/gif image-data.
Requires that the guild have the INVITE_SPLASH
feature enabled.
You can check this through a guild’s features
list.
pub fn discovery_splash(&mut self, splash: Option<&str>) -> &mut Self
[src]
pub fn discovery_splash(&mut self, splash: Option<&str>) -> &mut Self
[src]Set the splash image of the guild on the discovery page.
The splash
must be base64-encoded 1024x1024 png/jpeg/gif image-data.
Requires that the guild have the DISCOVERABLE
feature enabled.
You can check this through a guild’s features
list.
pub fn banner(&mut self, banner: Option<&str>) -> &mut Self
[src]
pub fn banner(&mut self, banner: Option<&str>) -> &mut Self
[src]Set the banner image of the guild, it appears on the left side-bar.
The banner
must be base64-encoded 16:9 png/jpeg image data.
Requires that the guild have the BANNER
feature enabled.
You can check this through a guild’s features
list.
pub fn system_channel_id(&mut self, channel_id: Option<ChannelId>) -> &mut Self
[src]
pub fn system_channel_id(&mut self, channel_id: Option<ChannelId>) -> &mut Self
[src]Set the channel ID where welcome messages and boost events will be posted.
pub fn rules_channel_id(&mut self, channel_id: Option<ChannelId>) -> &mut Self
[src]
pub fn rules_channel_id(&mut self, channel_id: Option<ChannelId>) -> &mut Self
[src]Set the channel ID of the rules and guidelines channel.
Note: This feature is for Community guilds only.
pub fn public_updates_channel_id(
&mut self,
channel_id: Option<ChannelId>
) -> &mut Self
[src]
pub fn public_updates_channel_id(
&mut self,
channel_id: Option<ChannelId>
) -> &mut Self
[src]Set the channel ID where admins and moderators receive update messages from Discord.
Note: This feature is for Community guilds only.
pub fn preferred_locale(&mut self, locale: Option<&str>) -> &mut Self
[src]
pub fn preferred_locale(&mut self, locale: Option<&str>) -> &mut Self
[src]Set the preferred locale used in Server Discovery and update messages from Discord.
If this is not set, the locale will default to “en-US”;
Note: This feature is for Community guilds only.
pub fn explicit_content_filter(
&mut self,
level: Option<ExplicitContentFilter>
) -> &mut Self
[src]
pub fn explicit_content_filter(
&mut self,
level: Option<ExplicitContentFilter>
) -> &mut Self
[src]Set the content filter level.
pub fn default_message_notifications(
&mut self,
level: Option<DefaultMessageNotificationLevel>
) -> &mut Self
[src]
pub fn default_message_notifications(
&mut self,
level: Option<DefaultMessageNotificationLevel>
) -> &mut Self
[src]Set the default message notification level.
pub fn verification_level<V>(&mut self, verification_level: V) -> &mut Self where
V: Into<VerificationLevel>,
[src]
pub fn verification_level<V>(&mut self, verification_level: V) -> &mut Self where
V: Into<VerificationLevel>,
[src]Set the verification level of the guild. This can restrict what a user must have prior to being able to send messages in a guild.
Refer to the documentation for VerificationLevel
for more
information on each variant.
Examples
Setting the verification level to High
:
use serenity::model::guild::VerificationLevel; // assuming a `guild` has already been bound let edit = guild.edit(&http, |g| { g.verification_level(VerificationLevel::High) }) .await; if let Err(why) = edit { println!("Error setting verification level: {:?}", why); }
pub fn system_channel_flags(
&mut self,
system_channel_flags: SystemChannelFlags
) -> &mut Self
[src]
pub fn system_channel_flags(
&mut self,
system_channel_flags: SystemChannelFlags
) -> &mut Self
[src]Modifies the notifications that are sent by discord to the configured system channel.
use serenity::model::guild::SystemChannelFlags; // assuming a `guild` has already been bound let edit = guild.edit(&http, |g| { g.system_channel_flags(SystemChannelFlags::SUPPRESS_JOIN_NOTIFICATIONS | SystemChannelFlags::SUPPRESS_GUILD_REMINDER_NOTIFICATIONS) }) .await; if let Err(why) = edit { println!("Error setting verification level: {:?}", why); }
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for EditGuild
impl Send for EditGuild
impl Sync for EditGuild
impl Unpin for EditGuild
impl UnwindSafe for EditGuild
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,