Struct GuildView

Source
pub struct GuildView { /* private fields */ }
Expand description

A view for interfacing with a Discord guild.

Implementations§

Source§

impl GuildView

Source

pub fn modify( &self, opts: ModifyGuildOptions, ) -> impl Future<Item = Guild, Error = Error>

Modifies the settings of this guild.

Source

pub fn delete(&self) -> impl Future<Item = (), Error = Error>

Deletes this guild from Discord.

Source

pub fn get_channels(&self) -> impl Future<Item = Vec<Channel>, Error = Error>

Fetches all channels in the current guild.

Source

pub fn create_channel( &self, opts: CreateChannelOptions, ) -> impl Future<Item = Channel, Error = Error>

Creates a new channel in this guild.

Source

pub fn modify_channel_positions(&self)

Modifies a set of channel positions in this guild.

Source

pub fn get_webhooks(&self) -> impl Future<Item = Webhook, Error = Error>

Gets a list of webhooks that belong to this guild.

Source

pub fn get_member( &self, id: &Snowflake, ) -> impl Future<Item = GuildMember, Error = Error>

Gets a guild member of the specified user id.

Source

pub fn list_members( &self, opts: ListMembersOptions, ) -> impl Future<Item = Vec<GuildMember>, Error = Error>

Lists all guild members in the current guild.

Source

pub fn add_member( &self, id: &Snowflake, opts: AddMemberOptions, ) -> impl Future<Item = GuildMember, Error = Error>

Adds a member to the guild, using an Oauth2 access token.

Source

pub fn add_member_role( &self, member: &Snowflake, role: &Snowflake, ) -> impl Future<Item = (), Error = Error>

Adds a role to the specified guild member.

Source

pub fn get_emojis(&self) -> impl Future<Item = Vec<Emoji>, Error = Error>

Gets a list of emojis in the guild.

Source

pub fn get_emoji( &self, emoji: &Snowflake, ) -> impl Future<Item = Emoji, Error = Error>

Gets a a single emoji by snowflake in the guild.

Source

pub fn create_emoji( &self, opts: CreateEmojiOptions, ) -> impl Future<Item = Emoji, Error = Error>

Creates a new emoji in this guild, with the provided options.

Source

pub fn modify_emoji( &self, id: &Snowflake, opts: ModifyGuildEmbedOptions, ) -> impl Future<Item = Emoji, Error = Error>

Modifies the provided emoji with the given options.

Source

pub fn delete_emoji( &self, id: &Snowflake, ) -> impl Future<Item = (), Error = Error>

Deletes the provided emoji from the guild.

Source

pub fn get_audit_log( &self, opts: GetAuditLogOptions, ) -> impl Future<Item = GuildAuditLog, Error = Error>

Fetches the audit log for this guild.

Source

pub fn get_bans(&self) -> impl Future<Item = Vec<GuildBan>, Error = Error>

Gets a list of bans in the guild.

Source

pub fn get_ban( &self, user: &Snowflake, ) -> impl Future<Item = GuildBan, Error = Error>

Gets a a single ban for the provided user in the guild.

Source

pub fn remove_ban( &self, user: &Snowflake, ) -> impl Future<Item = (), Error = Error>

Removes a ban for the provided user from the guild.

Source

pub fn get_roles(&self) -> impl Future<Item = Vec<Role>, Error = Error>

Gets a collection of roles from the guild.

Source

pub fn create_role( &self, opts: CreateRoleOptions, ) -> impl Future<Item = Role, Error = Error>

Creates a role in the guild.

Source

pub fn modify_role( &self, role: &Snowflake, opts: ModifyRoleOptions, ) -> impl Future<Item = Role, Error = Error>

Modifies the provided role in the guild.

Source

pub fn get_prune_count( &self, days: i32, ) -> impl Future<Item = GuildPrune, Error = Error>

Gets the number of members who would be pruned in a prune operation.

Source

pub fn prune_members( &self, days: i32, compute: bool, ) -> impl Future<Item = GuildPrune, Error = Error>

Prunes guild members, according to the provided options.

Source

pub fn get_voice_regions( &self, ) -> impl Future<Item = Vec<VoiceRegion>, Error = Error>

Gets a list of voice regions for the guild.

Source

pub fn get_invites(&self) -> impl Future<Item = Vec<Invite>, Error = Error>

Gets a list of guild invites.

Source

pub fn get_integrations( &self, ) -> impl Future<Item = Vec<GuildIntegration>, Error = Error>

Gets a list of guild integrations.

Source

pub fn add_integration( &self, kind: &str, id: &Snowflake, ) -> impl Future<Item = (), Error = Error>

Attaches an integration from the current user to the guild.

Source

pub fn modify_integration( &self, id: &Snowflake, opts: ModifyGuildIntegrationOptions, ) -> impl Future<Item = (), Error = Error>

Modifies the behavior and settings of a guild integration.

Source

pub fn delete_integration( &self, id: &Snowflake, ) -> impl Future<Item = (), Error = Error>

Deletes a guild integration by the provided ID.

Source

pub fn sync_integration( &self, id: &Snowflake, ) -> impl Future<Item = (), Error = Error>

Syncs guild integration by the provided ID.

Source

pub fn get_embed(&self) -> impl Future<Item = GuildEmbed, Error = Error>

Gets the embed object of this guild.

Source

pub fn modify_embed( &self, opts: ModifyGuildEmbedOptions, ) -> impl Future<Item = GuildEmbed, Error = Error>

Modifies the current guild embed.

Source

pub fn modify_role_positions(&self)

Modifies a set of role positions in the guild.

Source

pub fn remove_member_role( &self, member: &Snowflake, role: &Snowflake, ) -> impl Future<Item = (), Error = Error>

Removes a role from the specified guild member.

Source

pub fn modify_member( &self, id: &Snowflake, opts: ModifyMemberOptions, ) -> impl Future<Item = (), Error = Error>

Modifies a guild member in this guild.

Source

pub fn remove_member( &self, member: &Snowflake, ) -> impl Future<Item = (), Error = Error>

Removes a guild member from the guild.

Source

pub fn set_current_user_nick( &self, nick: &str, ) -> impl Future<Item = String, Error = Error>

Sets the nickname of the current client user.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Err = <U as TryFrom<T>>::Err

Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Err>

Source§

impl<T> Erased for T

Source§

impl<T> ErasedDestructor for T
where T: 'static,