Skip to content

abrzv/vkreal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vkreal

Simple asynchronus wrapper for vk_api.

Version 1.0.0.

It isn't ideal, but it works...

Орех




Documentation

vkreal.VkApi(token, sess = None, v = "5.125")

  • token

Token from vk api, that you can get, using oauth.vk.com

  • sess

httpx.AsyncClient. You can use your own session, for example for using methods with proxy.

  • v

Vk api version.


vkreal.VkApi.api_context()

Creates and initializes ApiContext object with current VkApi object.


vkreal.VkApi.method(name, params)

  • name

Method name. You can see a list of all methods here.

  • params

Parameters, with which method will be called. You can see it in https://vk.com/dev/method.name


vkreal.ApiContext(api)

Wrapper, for using api methods as ordinary class methods.

  • api

Initialized VkApi object.


vkreal.VkLongPoll(api, v = "3", mode = 10, get_pts = False, loop = None)

  • api

VkApi object for longpoll initialization.

  • v

Longpoll version.

  • mode

Longpoll mode.

  • get_pts

This parameter reserved.

  • loop

Asyncio loop, which will be used by event listener and handlers.


vkreal.VkLongPoll._init_server(get_ts = True)

Saving credintails for longpoll.

  • get_ts

This parameter reserved.


vkreal.VkLongPoll.get_event()

Getting one not-parsed event from longpoll.


vkreal.VkLongPoll.listen()

Longpoll-listening generator, yield parsed events.


vkreal.VkLongPoll.on_event(function)

Adding an async event handler.

  • function

Asynchronus callback function, that will handle events. on_event listener call this function with passing event in first argument.


vkreal.VkBotLongPoll(api, group_id, loop = None)

Group longpoll using the same functions, as user longpoll.

  • api

VkApi object for group longpoll initialization.

  • group_id

Id of group, in which longpoll will be setted.

  • loop

Asyncio loop, which will be used by event listener and handlers.


vkreal.EventCreationTool.convert_event(event)

Parsing array-event to dict.

  • event

Source array-event.

Releases

No releases published

Packages

No packages published

Languages