pub struct VkApi { /* private fields */ }Implementations§
Source§impl VkApi
impl VkApi
pub fn new<T: Into<String>>(token: T) -> VkResult<Self>
pub fn builder() -> VkApiBuilder
pub fn token(&self) -> &str
pub fn version(&self) -> &str
pub async fn call_method( &self, method: &str, params: HashMap<String, String>, ) -> VkResult<Value>
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>
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>
pub async fn messages_delete( &self, message_ids: &[i64], delete_for_all: bool, spam: bool, ) -> VkResult<Map<String, Value>>
pub async fn messages_restore(&self, message_id: i64) -> VkResult<bool>
pub async fn messages_mark_as_read( &self, peer_id: i64, start_message_id: Option<i64>, ) -> VkResult<bool>
pub async fn messages_mark_as_important( &self, message_ids: &[i64], important: Option<i32>, ) -> VkResult<Vec<i64>>
pub async fn messages_get_conversations( &self, offset: i32, count: i32, filter: Option<&str>, ) -> VkResult<Value>
pub async fn messages_get_conversation_members( &self, peer_id: i64, fields: Option<&str>, ) -> VkResult<Value>
pub async fn messages_get_history( &self, peer_id: i64, offset: i32, count: i32, start_message_id: Option<i64>, rev: bool, ) -> VkResult<Value>
pub async fn messages_get_by_id( &self, message_ids: &[i64], preview_length: i32, extended: bool, ) -> VkResult<Value>
pub async fn messages_search( &self, query: &str, peer_id: Option<i64>, date: Option<i64>, count: i32, ) -> VkResult<Value>
pub async fn messages_search_conversations( &self, query: &str, count: i32, extended: bool, fields: Option<&str>, ) -> VkResult<Value>
pub async fn messages_get_attachments( &self, peer_id: i64, media_type: &str, start_from: Option<&str>, count: i32, ) -> VkResult<Value>
pub async fn messages_get_invite_link( &self, peer_id: i64, reset: bool, ) -> VkResult<String>
pub async fn messages_remove_chat_user( &self, chat_id: i64, user_id: i64, member_id: Option<i64>, ) -> VkResult<bool>
pub async fn messages_add_chat_user( &self, chat_id: i64, user_id: i64, ) -> VkResult<bool>
pub async fn messages_create_chat( &self, user_ids: &[i64], title: Option<&str>, ) -> VkResult<i64>
pub async fn messages_set_activity( &self, peer_id: i64, user_id: Option<i64>, activity_type: &str, ) -> VkResult<bool>
pub async fn messages_send_message_event_answer( &self, event_id: &str, user_id: i64, peer_id: i64, event_data: Option<&str>, ) -> VkResult<bool>
pub async fn users_get( &self, user_ids: &[i64], fields: Option<&str>, name_case: Option<&str>, ) -> VkResult<Value>
pub async fn groups_get_long_poll_server( &self, group_id: i64, ) -> VkResult<LongPollServer>
pub async fn groups_get_by_id( &self, group_ids: &[i64], fields: Option<&str>, ) -> VkResult<Value>
pub async fn send_message(&self, peer_id: i64, message: &str) -> VkResult<i64>
pub async fn send_message_with_keyboard( &self, peer_id: i64, message: &str, keyboard: &Keyboard, ) -> VkResult<i64>
pub async fn send_reply( &self, peer_id: i64, message: &str, reply_to: i64, ) -> VkResult<i64>
Sourcepub async fn photos_get_messages_upload_server(
&self,
peer_id: i64,
) -> VkResult<UploadServer>
pub async fn photos_get_messages_upload_server( &self, peer_id: i64, ) -> VkResult<UploadServer>
Get upload server for photos
Sourcepub async fn photos_save_messages_photo(
&self,
photo: &str,
server: i64,
hash: &str,
) -> VkResult<Vec<SavedPhoto>>
pub async fn photos_save_messages_photo( &self, photo: &str, server: i64, hash: &str, ) -> VkResult<Vec<SavedPhoto>>
Save uploaded photo
Sourcepub async fn docs_get_upload_server(
&self,
peer_id: Option<i64>,
doc_type: Option<&str>,
) -> VkResult<UploadServer>
pub async fn docs_get_upload_server( &self, peer_id: Option<i64>, doc_type: Option<&str>, ) -> VkResult<UploadServer>
Get upload server for documents
Sourcepub async fn docs_get_messages_upload_server(
&self,
peer_id: i64,
doc_type: Option<&str>,
) -> VkResult<UploadServer>
pub async fn docs_get_messages_upload_server( &self, peer_id: i64, doc_type: Option<&str>, ) -> VkResult<UploadServer>
Get upload server for documents (for community messages)
Sourcepub async fn docs_save(
&self,
file: &str,
title: Option<&str>,
tags: Option<&str>,
) -> VkResult<SavedDocument>
pub async fn docs_save( &self, file: &str, title: Option<&str>, tags: Option<&str>, ) -> VkResult<SavedDocument>
Save uploaded document
Sourcepub async fn upload_file(
&self,
upload_url: &str,
file_data: Vec<u8>,
filename: &str,
) -> VkResult<UploadResponse>
pub async fn upload_file( &self, upload_url: &str, file_data: Vec<u8>, filename: &str, ) -> VkResult<UploadResponse>
Upload file to VK server
Sourcepub async fn send_photo(
&self,
peer_id: i64,
photo_data: Vec<u8>,
filename: &str,
caption: Option<&str>,
) -> VkResult<i64>
pub async fn send_photo( &self, peer_id: i64, photo_data: Vec<u8>, filename: &str, caption: Option<&str>, ) -> VkResult<i64>
Upload and send photo
Sourcepub async fn send_document(
&self,
peer_id: i64,
file_data: Vec<u8>,
filename: &str,
title: Option<&str>,
caption: Option<&str>,
) -> VkResult<i64>
pub async fn send_document( &self, peer_id: i64, file_data: Vec<u8>, filename: &str, title: Option<&str>, caption: Option<&str>, ) -> VkResult<i64>
Upload and send document
Sourcepub async fn send_voice_message(
&self,
peer_id: i64,
audio_data: Vec<u8>,
filename: &str,
) -> VkResult<i64>
pub async fn send_voice_message( &self, peer_id: i64, audio_data: Vec<u8>, filename: &str, ) -> VkResult<i64>
Upload and send audio message (voice message)
Sourcepub async fn download_file(&self, url: &str) -> VkResult<DownloadedFile>
pub async fn download_file(&self, url: &str) -> VkResult<DownloadedFile>
Download file from URL
Sourcepub async fn download_photo(&self, photo: &Photo) -> VkResult<DownloadedFile>
pub async fn download_photo(&self, photo: &Photo) -> VkResult<DownloadedFile>
Download photo by attachment
Sourcepub async fn download_document(
&self,
doc: &Document,
) -> VkResult<DownloadedFile>
pub async fn download_document( &self, doc: &Document, ) -> VkResult<DownloadedFile>
Download document
Sourcepub async fn download_audio(&self, audio: &Audio) -> VkResult<DownloadedFile>
pub async fn download_audio(&self, audio: &Audio) -> VkResult<DownloadedFile>
Download audio
Sourcepub async fn download_video_thumbnail(
&self,
video: &Video,
) -> VkResult<DownloadedFile>
pub async fn download_video_thumbnail( &self, video: &Video, ) -> VkResult<DownloadedFile>
Download video thumbnail
Sourcepub async fn download_sticker(
&self,
sticker: &Sticker,
) -> VkResult<DownloadedFile>
pub async fn download_sticker( &self, sticker: &Sticker, ) -> VkResult<DownloadedFile>
Download sticker
Sourcepub async fn download_audio_message(
&self,
audio_msg: &AudioMessage,
) -> VkResult<DownloadedFile>
pub async fn download_audio_message( &self, audio_msg: &AudioMessage, ) -> VkResult<DownloadedFile>
Download audio message
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VkApi
impl !RefUnwindSafe for VkApi
impl Send for VkApi
impl Sync for VkApi
impl Unpin for VkApi
impl UnsafeUnpin for VkApi
impl !UnwindSafe for VkApi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more