Skip to main content

VkApi

Struct VkApi 

Source
pub struct VkApi { /* private fields */ }

Implementations§

Source§

impl VkApi

Source

pub fn new<T: Into<String>>(token: T) -> VkResult<Self>

Source

pub fn builder() -> VkApiBuilder

Source

pub fn token(&self) -> &str

Source

pub fn version(&self) -> &str

Source

pub async fn call_method( &self, method: &str, params: HashMap<String, String>, ) -> VkResult<Value>

Source

pub async fn messages_send( &self, peer_id: i64, message: &str, keyboard: Option<&Keyboard>, attachment: Option<&str>, sticker_id: Option<i64>, reply_to: Option<i64>, forward_messages: Option<&[i64]>, disable_mentions: bool, dont_parse_links: bool, random_id: Option<i64>, ) -> VkResult<i64>

Source

pub async fn messages_edit( &self, peer_id: i64, message_id: i64, message: &str, keyboard: Option<&Keyboard>, attachment: Option<&str>, keep_forward_messages: bool, keep_snippets: bool, ) -> VkResult<bool>

Source

pub async fn messages_delete( &self, message_ids: &[i64], delete_for_all: bool, spam: bool, ) -> VkResult<Map<String, Value>>

Source

pub async fn messages_restore(&self, message_id: i64) -> VkResult<bool>

Source

pub async fn messages_mark_as_read( &self, peer_id: i64, start_message_id: Option<i64>, ) -> VkResult<bool>

Source

pub async fn messages_mark_as_important( &self, message_ids: &[i64], important: Option<i32>, ) -> VkResult<Vec<i64>>

Source

pub async fn messages_get_conversations( &self, offset: i32, count: i32, filter: Option<&str>, ) -> VkResult<Value>

Source

pub async fn messages_get_conversation_members( &self, peer_id: i64, fields: Option<&str>, ) -> VkResult<Value>

Source

pub async fn messages_get_history( &self, peer_id: i64, offset: i32, count: i32, start_message_id: Option<i64>, rev: bool, ) -> VkResult<Value>

Source

pub async fn messages_get_by_id( &self, message_ids: &[i64], preview_length: i32, extended: bool, ) -> VkResult<Value>

Source

pub async fn messages_search_conversations( &self, query: &str, count: i32, extended: bool, fields: Option<&str>, ) -> VkResult<Value>

Source

pub async fn messages_get_attachments( &self, peer_id: i64, media_type: &str, start_from: Option<&str>, count: i32, ) -> VkResult<Value>

Source

pub async fn messages_remove_chat_user( &self, chat_id: i64, user_id: i64, member_id: Option<i64>, ) -> VkResult<bool>

Source

pub async fn messages_add_chat_user( &self, chat_id: i64, user_id: i64, ) -> VkResult<bool>

Source

pub async fn messages_create_chat( &self, user_ids: &[i64], title: Option<&str>, ) -> VkResult<i64>

Source

pub async fn messages_set_activity( &self, peer_id: i64, user_id: Option<i64>, activity_type: &str, ) -> VkResult<bool>

Source

pub async fn messages_send_message_event_answer( &self, event_id: &str, user_id: i64, peer_id: i64, event_data: Option<&str>, ) -> VkResult<bool>

Source

pub async fn users_get( &self, user_ids: &[i64], fields: Option<&str>, name_case: Option<&str>, ) -> VkResult<Value>

Source

pub async fn groups_get_long_poll_server( &self, group_id: i64, ) -> VkResult<LongPollServer>

Source

pub async fn groups_get_by_id( &self, group_ids: &[i64], fields: Option<&str>, ) -> VkResult<Value>

Source

pub async fn send_message(&self, peer_id: i64, message: &str) -> VkResult<i64>

Source

pub async fn send_message_with_keyboard( &self, peer_id: i64, message: &str, keyboard: &Keyboard, ) -> VkResult<i64>

Source

pub async fn send_reply( &self, peer_id: i64, message: &str, reply_to: i64, ) -> VkResult<i64>

Trait Implementations§

Source§

impl Clone for VkApi

Source§

fn clone(&self) -> VkApi

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VkApi

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for VkApi

§

impl !RefUnwindSafe for VkApi

§

impl Send for VkApi

§

impl Sync for VkApi

§

impl Unpin for VkApi

§

impl !UnwindSafe for VkApi

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more