vkpore.vkclient module

Module with classes related to interacting with Vkontakte.

class vkpore.vkclient.Request(method, arguments)[source]

Bases: _asyncio.Future

Request in queue for execution.

arguments
method
class vkpore.vkclient.VkClient(token: str, session: aiohttp.client.ClientSession = None, loop: asyncio.events.AbstractEventLoop = None)[source]

Bases: object

Class for interacting with Vkontakte.

close_session()[source]

Close this client’s session.

group_id

Client’s group id

group_name

Client’s group name

initialize(enable_longpoll=True)[source]

Check token and get information about group.

longpoll(default_longpoll=None) → Callable[[], Callable[[], List[Dict[KT, VT]]]][source]

Return coroutine for receiving updates for current group from vkontakte using Bots Longpoll API.

raw_request(method: str, **kwargs)[source]

Perform a request to method with arguments. Access token and version added explicitly, but you can override it with your arguments. Returns response or None if error occured.

request(method: str, **kwargs)[source]

Perform a request to method with arguments. Access token and version added explicitly, but you can override it with your arguments. Request if performed from background loop and is batched in order to use execute method. Returns response or None if error occured.

start()[source]

Start loop for executing requests with request method. Loop allows usage of batching and execute method. Returns awaitable with loop. Only one loop cann run for instance of client.

stop()[source]

Attempts to stop background loop and waits for it to actually stop.