vkpore.vkpore module

Module with core class for organizing event flow.

class vkpore.vkpore.Vkpore(tokens: Iterable[str], loop: asyncio.events.AbstractEventLoop = None, session: aiohttp.client.ClientSession = None)[source]

Bases: object

Class for receiving events, calling methods, callback registration and execution. You can specify loop and session to use.

dispatch(event: vkpore.events.Event)[source]

Call callbacks for event.

get_client(group_id)[source]

Return random client for specified group_id.

on(event: str)[source]

Return decorator for subscribing callback to event.

run()[source]

Run application and stop on KeyboardInterrupt.

run_until_complete(awaitable: Awaitable[T_co])[source]

Run specified awaitable in application’s loop.

start()[source]

Start application related loops and perform initializations.

stop()[source]

Stop client loops, wait for all tasks to complete and close sessions.