vkpore.events module

Module with possible events and classes/functions related to that.

class vkpore.events.Event(name: str, group_id: int, source: Dict[KT, VT])[source]

Bases: abc.ABC

Base class for possible events.

group_id

Event’s group id.

initialize(app, callbacks: List[Callable[[Event], Awaitable[T_co]]])[source]

Set app amd callbacks that will process this event.

name

Event’s internal name (like “vk:<event’s name>”)

next()[source]

Call next callback from the list.

request(method, **kwargs)[source]

Proxy for VkClient’s request.

source

Raw object of event.

class vkpore.events.EventRaw(group_id, source: Dict[KT, VT])[source]

Bases: vkpore.events.Event

Raw event from vkontakte. Used for passing unknown events.

class vkpore.events.MessageData(name, group_id, source: Dict[KT, VT])[source]

Bases: vkpore.events.Event

Class for storing data about personal message in vkontakte. Documentation: https://vk.com/dev/objects/message

action

Message action if present

attachments

Message attachments

date

Message date in unixtime

from_id

Message from id

fwd_messages

Forwarded messages

id

Message id

important

Message important flag

out

Message out flag

payload

Message payload

peer_id

Message peer id

random_id

Message random id

reply_message

Message reply message if present

response(message: str)[source]

Response to channel event was received from.

text

Message text if present

class vkpore.events.MessageNew(group_id, source: Dict[KT, VT])[source]

Bases: vkpore.events.MessageData

Vkontakte “message_new” event.

vkpore.events.random() → x in the interval [0, 1).