Skip to content

Commit

Permalink
Add VkEventType.USER_RECORDING_VOICE, update API version to 5.87
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor authored and python273 committed Nov 23, 2018
1 parent 3eba668 commit e08dd43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions vk_api/longpoll.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ class VkEventType(IntEnum):
#: Пользователь $user_id набирает текст в беседе $chat_id.
USER_TYPING_IN_CHAT = 62

#: Пользователь $user_id записывает голосовое сообщение в диалоге/беседе $peer_id
USER_RECORDING_VOICE = 64

#: Пользователь $user_id совершил звонок с идентификатором $call_id.
USER_CALL = 70

Expand Down Expand Up @@ -285,6 +288,7 @@ class VkChatEventType(IntEnum):

VkEventType.USER_TYPING: ['user_id', 'flags'],
VkEventType.USER_TYPING_IN_CHAT: ['user_id', 'chat_id'],
VkEventType.USER_RECORDING_VOICE: ['peer_id', 'user_id', 'flags', 'timestamp'],

VkEventType.USER_CALL: ['user_id', 'call_id'],

Expand Down Expand Up @@ -381,6 +385,10 @@ def __init__(self, raw):
self.user_id = abs(self.user_id)
self._parse_online_status()

elif self.type is VkEventType.USER_RECORDING_VOICE:
if isinstance(self.user_id, list):
self.user_id = self.user_id[0]

if self.timestamp:
self.datetime = datetime.utcfromtimestamp(self.timestamp)

Expand Down
2 changes: 1 addition & 1 deletion vk_api/vk_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class VkApi(object):
def __init__(self, login=None, password=None, token=None,
auth_handler=None, captcha_handler=None,
config=jconfig.Config, config_filename='vk_config.v2.json',
api_version='5.85', app_id=6222115, scope=DEFAULT_USER_SCOPE,
api_version='5.92', app_id=6222115, scope=DEFAULT_USER_SCOPE,
client_secret=None):

self.login = login
Expand Down

0 comments on commit e08dd43

Please sign in to comment.