[−][src]Struct serenity::builder::EditGuild
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.
Methods
impl EditGuild
[src]
pub fn afk_channel<C: Into<ChannelId>>(
&mut self,
channel: Option<C>
) -> &mut Self
[src]
&mut self,
channel: Option<C>
) -> &mut Self
Set the "AFK voice channel" that users are to move to if they have been
AFK for an amount of time, configurable by 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]
Set the amount of time a user is to be moved to the AFK channel -
configured via afk_channel
- after being AFK.
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)) })?;
pub fn name(&mut self, name: &str) -> &mut Self
[src]
Set the name of the guild.
Note: Must be between (and including) 2-100 chracters.
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]
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) })?;
pub fn splash(&mut self, splash: Option<&str>) -> &mut Self
[src]
Set the splash image of the guild on the invitation page.
Requires that the guild have the INVITE_SPLASH
feature enabled.
You can check this through a guild's features
list.
pub fn verification_level<V>(&mut self, verification_level: V) -> &mut Self where
V: Into<VerificationLevel>,
[src]
V: Into<VerificationLevel>,
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) }); if let Err(why) = edit { println!("Error setting verification level: {:?}", why); } // additionally, you may pass in just an integer of the verification // level let edit = guild.edit(&http, |g| { g.verification_level(3) }); if let Err(why) = edit { println!("Error setting verification level: {:?}", why); }
Trait Implementations
impl Default for EditGuild
[src]
impl Clone for EditGuild
[src]
fn clone(&self) -> EditGuild
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for EditGuild
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<T> DebugAny for T where
T: Any + Debug,
[src]
T: Any + Debug,
impl<T> CloneAny for T where
T: Clone + Any,
[src]
T: Clone + Any,
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
[src]
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
[src]
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
[src]
T: Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
[src]
T: Send + Sync,
impl<T> UnsafeAny for T where
T: Any,
T: Any,