[−][src]Struct automate::Context
Context about the current gateway session. Provides a way to interact with Discord HTTP API by dereferencing to HttpAPI.
Fields
bot: &'a User
Implementations
impl<'a> Context<'a>
[src]
pub async fn update_status<'_>(
&'_ self,
data: UpdateStatus
) -> Result<(), Error>
[src]
&'_ self,
data: UpdateStatus
) -> Result<(), Error>
Indicate a presence or status update.
pub async fn update_voice_state<'_>(
&'_ self,
data: UpdateVoiceState
) -> Result<(), Error>
[src]
&'_ self,
data: UpdateVoiceState
) -> Result<(), Error>
Join, move or disconnect from a voice channel.
pub async fn request_guild_members<'_>(
&'_ self,
data: RequestGuildMembers
) -> Result<(), Error>
[src]
&'_ self,
data: RequestGuildMembers
) -> Result<(), Error>
Request members of a guild.
pub async fn storage<T: Stored + 'static, '_, '_>(
&'_ self
) -> RwLockReadGuard<'_, T::Storage>
[src]
&'_ self
) -> RwLockReadGuard<'_, T::Storage>
Read only reference to the storage of the specified type.
pub async fn storage_mut<T: Stored + 'static, '_, '_>(
&'_ self
) -> RwLockWriteGuard<'_, T::Storage>
[src]
&'_ self
) -> RwLockWriteGuard<'_, T::Storage>
Writable reference to the storage of the specified type. Getting a writable version of GuildStorage, ChannelStorage or UserStorage is useless since they are not mutable
pub fn invite_bot(&self, permission: u32) -> String
[src]
Creates a link to invite the bot to a discord server and give him the specified permissions.
Methods from Deref<Target = HttpAPI>
pub fn token(&self) -> &String
[src]
pub async fn gateway<'_>(&'_ self) -> Result<Gateway, Error>
[src]
pub async fn gateway_bot<'_>(&'_ self) -> Result<GatewayBot, Error>
[src]
pub async fn audit_logs<S: ExtractSnowflake, '_>(
&'_ self,
guild: S
) -> Result<AuditLog, Error>
[src]
&'_ self,
guild: S
) -> Result<AuditLog, Error>
pub async fn guild<S: ExtractSnowflake, '_>(
&'_ self,
guild: S
) -> Result<Guild, Error>
[src]
&'_ self,
guild: S
) -> Result<Guild, Error>
pub async fn create_guild<'_>(
&'_ self,
new_guild: NewGuild
) -> Result<Guild, Error>
[src]
&'_ self,
new_guild: NewGuild
) -> Result<Guild, Error>
pub async fn modify_guild<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
modification: ModifyGuild
) -> Result<Guild, Error>
[src]
&'_ self,
guild: S,
modification: ModifyGuild
) -> Result<Guild, Error>
pub async fn delete_guild<S: ExtractSnowflake, '_>(
&'_ self,
guild: S
) -> Result<(), Error>
[src]
&'_ self,
guild: S
) -> Result<(), Error>
pub async fn channels<S: ExtractSnowflake, '_>(
&'_ self,
guild: S
) -> Result<Vec<GuildChannel>, Error>
[src]
&'_ self,
guild: S
) -> Result<Vec<GuildChannel>, Error>
pub async fn channel<S: ExtractSnowflake, '_>(
&'_ self,
channel: S
) -> Result<Channel, Error>
[src]
&'_ self,
channel: S
) -> Result<Channel, Error>
pub async fn create_channel<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
new_channel: NewChannel
) -> Result<GuildChannel, Error>
[src]
&'_ self,
guild: S,
new_channel: NewChannel
) -> Result<GuildChannel, Error>
pub async fn modify_channel<S: ExtractSnowflake, '_>(
&'_ self,
channel: S,
modification: ModifyChannel
) -> Result<Channel, Error>
[src]
&'_ self,
channel: S,
modification: ModifyChannel
) -> Result<Channel, Error>
pub async fn move_channels<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
moves: Vec<MoveChannel>
) -> Result<(), Error>
[src]
&'_ self,
guild: S,
moves: Vec<MoveChannel>
) -> Result<(), Error>
pub async fn delete_channel<S: ExtractSnowflake, '_>(
&'_ self,
channel: S
) -> Result<Channel, Error>
[src]
&'_ self,
channel: S
) -> Result<Channel, Error>
pub async fn member<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
user: S
) -> Result<GuildMember, Error>
[src]
&'_ self,
guild: S,
user: S
) -> Result<GuildMember, Error>
pub async fn members<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
filter: MemberFilter
) -> Result<Vec<GuildMember>, Error>
[src]
&'_ self,
guild: S,
filter: MemberFilter
) -> Result<Vec<GuildMember>, Error>
pub async fn modify_member<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
user: S,
member: ModifyMember
) -> Result<(), Error>
[src]
&'_ self,
guild: S,
user: S,
member: ModifyMember
) -> Result<(), Error>
pub async fn remove_member<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
user: S
) -> Result<(), Error>
[src]
&'_ self,
guild: S,
user: S
) -> Result<(), Error>
pub async fn modify_own_nick<S: ExtractSnowflake, '_, '_>(
&'_ self,
guild: S,
nick: &'_ str
) -> Result<(), Error>
[src]
&'_ self,
guild: S,
nick: &'_ str
) -> Result<(), Error>
pub async fn member_add_role<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
user: S,
role: S
) -> Result<(), Error>
[src]
&'_ self,
guild: S,
user: S,
role: S
) -> Result<(), Error>
pub async fn member_remove_role<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
user: S,
role: S
) -> Result<(), Error>
[src]
&'_ self,
guild: S,
user: S,
role: S
) -> Result<(), Error>
pub async fn bans<S: ExtractSnowflake, '_>(
&'_ self,
guild: S
) -> Result<Vec<Ban>, Error>
[src]
&'_ self,
guild: S
) -> Result<Vec<Ban>, Error>
pub async fn ban<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
user: S
) -> Result<Ban, Error>
[src]
&'_ self,
guild: S,
user: S
) -> Result<Ban, Error>
pub async fn create_ban<S: ExtractSnowflake, '_, '_>(
&'_ self,
guild: S,
user: S,
reason: Option<&'_ str>,
delete_days: Option<i8>
) -> Result<(), Error>
[src]
&'_ self,
guild: S,
user: S,
reason: Option<&'_ str>,
delete_days: Option<i8>
) -> Result<(), Error>
pub async fn remove_ban<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
user: S
) -> Result<(), Error>
[src]
&'_ self,
guild: S,
user: S
) -> Result<(), Error>
pub async fn roles<S: ExtractSnowflake, '_>(
&'_ self,
guild: S
) -> Result<Vec<Role>, Error>
[src]
&'_ self,
guild: S
) -> Result<Vec<Role>, Error>
pub async fn create_role<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
role: NewRole
) -> Result<Role, Error>
[src]
&'_ self,
guild: S,
role: NewRole
) -> Result<Role, Error>
pub async fn modify_roles<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
role: S,
modification: ModifyRole
) -> Result<Role, Error>
[src]
&'_ self,
guild: S,
role: S,
modification: ModifyRole
) -> Result<Role, Error>
pub async fn move_roles<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
roles: Vec<MoveRole>
) -> Result<Vec<Role>, Error>
[src]
&'_ self,
guild: S,
roles: Vec<MoveRole>
) -> Result<Vec<Role>, Error>
pub async fn remove_role<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
role: S
) -> Result<(), Error>
[src]
&'_ self,
guild: S,
role: S
) -> Result<(), Error>
pub async fn simulate_prune<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
days: i32
) -> Result<Prune, Error>
[src]
&'_ self,
guild: S,
days: i32
) -> Result<Prune, Error>
pub async fn prune<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
days: i32
) -> Result<(), Error>
[src]
&'_ self,
guild: S,
days: i32
) -> Result<(), Error>
pub async fn prune_with_report<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
days: i32
) -> Result<Prune, Error>
[src]
&'_ self,
guild: S,
days: i32
) -> Result<Prune, Error>
pub async fn voice_regions<'_>(&'_ self) -> Result<Vec<VoiceRegion>, Error>
[src]
pub async fn guild_voice_regions<S: ExtractSnowflake, '_>(
&'_ self,
guild: S
) -> Result<Vec<VoiceRegion>, Error>
[src]
&'_ self,
guild: S
) -> Result<Vec<VoiceRegion>, Error>
pub async fn integrations<S: ExtractSnowflake, '_>(
&'_ self,
guild: S
) -> Result<Vec<Integration>, Error>
[src]
&'_ self,
guild: S
) -> Result<Vec<Integration>, Error>
pub async fn embed<S: ExtractSnowflake, '_>(
&'_ self,
guild: S
) -> Result<GuildEmbed, Error>
[src]
&'_ self,
guild: S
) -> Result<GuildEmbed, Error>
pub async fn modify_embed<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
embed: GuildEmbed
) -> Result<GuildEmbed, Error>
[src]
&'_ self,
guild: S,
embed: GuildEmbed
) -> Result<GuildEmbed, Error>
pub async fn vanity_url<S: ExtractSnowflake, '_>(
&'_ self,
guild: S
) -> Result<PartialInvite, Error>
[src]
&'_ self,
guild: S
) -> Result<PartialInvite, Error>
pub async fn message<S: ExtractSnowflake, '_>(
&'_ self,
channel: S,
message: S
) -> Result<Message, Error>
[src]
&'_ self,
channel: S,
message: S
) -> Result<Message, Error>
pub async fn messages<S: ExtractSnowflake, '_>(
&'_ self,
channel: S,
messages: MessagesPosition
) -> Result<Vec<Message>, Error>
[src]
&'_ self,
channel: S,
messages: MessagesPosition
) -> Result<Vec<Message>, Error>
pub async fn create_message<S: ExtractSnowflake, '_>(
&'_ self,
channel: S,
__arg2: CreateMessage
) -> Result<Message, Error>
[src]
&'_ self,
channel: S,
__arg2: CreateMessage
) -> Result<Message, Error>
pub async fn modify_message<S: ExtractSnowflake, '_>(
&'_ self,
channel: S,
message: S,
modification: ModifyMessage
) -> Result<Message, Error>
[src]
&'_ self,
channel: S,
message: S,
modification: ModifyMessage
) -> Result<Message, Error>
pub async fn delete_message<S: ExtractSnowflake, '_>(
&'_ self,
channel: S,
message: S
) -> Result<(), Error>
[src]
&'_ self,
channel: S,
message: S
) -> Result<(), Error>
pub async fn delete_message_bulk<S: ExtractSnowflake, '_>(
&'_ self,
channel: S,
messages: Vec<S>
) -> Result<(), Error>
[src]
&'_ self,
channel: S,
messages: Vec<S>
) -> Result<(), Error>
pub async fn reactions<S: ExtractSnowflake, U: WriteUrl, '_, '_>(
&'_ self,
channel: S,
message: S,
emoji: &'_ U,
reactions: ReactionsPosition
) -> Result<Vec<User>, Error>
[src]
&'_ self,
channel: S,
message: S,
emoji: &'_ U,
reactions: ReactionsPosition
) -> Result<Vec<User>, Error>
pub async fn create_reaction<S: ExtractSnowflake, U: WriteUrl, '_, '_>(
&'_ self,
channel: S,
message: S,
emoji: &'_ U
) -> Result<(), Error>
[src]
&'_ self,
channel: S,
message: S,
emoji: &'_ U
) -> Result<(), Error>
pub async fn delete_reaction<S: ExtractSnowflake, U: WriteUrl, '_, '_>(
&'_ self,
channel: S,
message: S,
emoji: &'_ U,
user: S
) -> Result<(), Error>
[src]
&'_ self,
channel: S,
message: S,
emoji: &'_ U,
user: S
) -> Result<(), Error>
pub async fn delete_own_reaction<S: ExtractSnowflake, U: WriteUrl, '_, '_>(
&'_ self,
channel: S,
message: S,
emoji: &'_ U
) -> Result<(), Error>
[src]
&'_ self,
channel: S,
message: S,
emoji: &'_ U
) -> Result<(), Error>
pub async fn delete_all_reaction<S: ExtractSnowflake, '_>(
&'_ self,
channel: S,
message: S
) -> Result<(), Error>
[src]
&'_ self,
channel: S,
message: S
) -> Result<(), Error>
pub async fn emojis<S: ExtractSnowflake, '_>(
&'_ self,
guild: S
) -> Result<Vec<Emoji>, Error>
[src]
&'_ self,
guild: S
) -> Result<Vec<Emoji>, Error>
pub async fn emoji<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
emoji: S
) -> Result<Emoji, Error>
[src]
&'_ self,
guild: S,
emoji: S
) -> Result<Emoji, Error>
pub async fn create_emoji<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
emoji: NewEmoji
) -> Result<Emoji, Error>
[src]
&'_ self,
guild: S,
emoji: NewEmoji
) -> Result<Emoji, Error>
pub async fn modify_emoji<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
emoji: S,
modification: ModifyEmoji
) -> Result<Emoji, Error>
[src]
&'_ self,
guild: S,
emoji: S,
modification: ModifyEmoji
) -> Result<Emoji, Error>
pub async fn delete_emoji<S: ExtractSnowflake, '_>(
&'_ self,
guild: S,
emoji: S
) -> Result<(), Error>
[src]
&'_ self,
guild: S,
emoji: S
) -> Result<(), Error>
pub async fn invite<'_, '_>(&'_ self, code: &'_ str) -> Result<Invite, Error>
[src]
pub async fn invite_with_counts<'_, '_>(
&'_ self,
code: &'_ str
) -> Result<Invite, Error>
[src]
&'_ self,
code: &'_ str
) -> Result<Invite, Error>
pub async fn guild_invites<S: ExtractSnowflake, '_>(
&'_ self,
guild: S
) -> Result<Vec<Invite>, Error>
[src]
&'_ self,
guild: S
) -> Result<Vec<Invite>, Error>
pub async fn channel_invites<S: ExtractSnowflake, '_>(
&'_ self,
channel: S
) -> Result<Vec<Invite>, Error>
[src]
&'_ self,
channel: S
) -> Result<Vec<Invite>, Error>
pub async fn create_invite<S: ExtractSnowflake, '_>(
&'_ self,
channel: S,
invite: NewInvite
) -> Result<Invite, Error>
[src]
&'_ self,
channel: S,
invite: NewInvite
) -> Result<Invite, Error>
pub async fn delete_invite<'_, '_>(
&'_ self,
code: &'_ str
) -> Result<Invite, Error>
[src]
&'_ self,
code: &'_ str
) -> Result<Invite, Error>
pub async fn modify_channel_permissions<S: ExtractSnowflake, '_>(
&'_ self,
channel: S,
overwrite: S,
permissions: NewOverwrite
) -> Result<(), Error>
[src]
&'_ self,
channel: S,
overwrite: S,
permissions: NewOverwrite
) -> Result<(), Error>
pub async fn delete_channel_permission<S: ExtractSnowflake, '_>(
&'_ self,
channel: S,
overwrite: S
) -> Result<(), Error>
[src]
&'_ self,
channel: S,
overwrite: S
) -> Result<(), Error>
pub async fn trigger_typing<S: ExtractSnowflake, '_>(
&'_ self,
channel: S
) -> Result<(), Error>
[src]
&'_ self,
channel: S
) -> Result<(), Error>
pub async fn pinned_messages<S: ExtractSnowflake, '_>(
&'_ self,
channel: S
) -> Result<Vec<Message>, Error>
[src]
&'_ self,
channel: S
) -> Result<Vec<Message>, Error>
pub async fn pin_message<S: ExtractSnowflake, '_>(
&'_ self,
channel: S,
message: S
) -> Result<(), Error>
[src]
&'_ self,
channel: S,
message: S
) -> Result<(), Error>
pub async fn unpin_message<S: ExtractSnowflake, '_>(
&'_ self,
channel: S,
message: S
) -> Result<(), Error>
[src]
&'_ self,
channel: S,
message: S
) -> Result<(), Error>
pub async fn curent_user<'_>(&'_ self) -> Result<User, Error>
[src]
pub async fn modify_current_user<'_>(
&'_ self,
bot: ModifyBot
) -> Result<User, Error>
[src]
&'_ self,
bot: ModifyBot
) -> Result<User, Error>
pub async fn bot_guilds<'_>(&'_ self) -> Result<Vec<PartialGuild>, Error>
[src]
pub async fn leave_guild<S: ExtractSnowflake, '_>(
&'_ self,
guild: S
) -> Result<(), Error>
[src]
&'_ self,
guild: S
) -> Result<(), Error>
pub async fn user<S: ExtractSnowflake, '_>(
&'_ self,
user: S
) -> Result<User, Error>
[src]
&'_ self,
user: S
) -> Result<User, Error>
pub async fn create_dm<S: ExtractSnowflake, '_>(
&'_ self,
recipient: S
) -> Result<DirectChannel, Error>
[src]
&'_ self,
recipient: S
) -> Result<DirectChannel, Error>
pub async fn add_dm_recipient<S: ExtractSnowflake, '_>(
&'_ self,
channel: S,
user: S,
recipient: Recipient
) -> Result<(), Error>
[src]
&'_ self,
channel: S,
user: S,
recipient: Recipient
) -> Result<(), Error>
pub async fn remove_dm_recipient<S: ExtractSnowflake, '_>(
&'_ self,
channel: S,
user: S
) -> Result<(), Error>
[src]
&'_ self,
channel: S,
user: S
) -> Result<(), Error>
pub async fn close_dm<S: ExtractSnowflake, '_>(
&'_ self,
channel: S
) -> Result<PrivateChannel, Error>
[src]
&'_ self,
channel: S
) -> Result<PrivateChannel, Error>
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Context<'a>
impl<'a> Send for Context<'a>
impl<'a> Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> !UnwindSafe for Context<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,