Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def __call__(
self, group_id: int
) -> responses.groups.GetCallbackConfirmationCode:
""" groups.getCallbackConfirmationCode
From Vk Docs: Returns Callback API confirmation code for the community.
Access from user, group token(s)
:param group_id: Community ID.
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
}
return await self.request(
"groups.getCallbackConfirmationCode",
params,
response_model=responses.groups.GetCallbackConfirmationCodeModel,
)
async def __call__(
self,
q: str,
type: str = None,
country_id: int = None,
city_id: int = None,
future: bool = None,
market: bool = None,
sort: int = None,
offset: int = None,
count: int = None,
) -> responses.groups.Search:
""" groups.search
From Vk Docs: Returns a list of communities matching the search criteria.
Access from user token(s)
:param q: Search query string.
:param type: Community type. Possible values: 'group, page, event.'
:param country_id: Country ID.
:param city_id: City ID. If this parameter is transmitted, country_id is ignored.
:param future: '1' — to return only upcoming events. Works with the 'type' = 'event' only.
:param market: '1' — to return communities with enabled market only.
:param sort: Sort order. Possible values: *'0' — default sorting (similar the full version of the site),, *'1' — by growth speed,, *'2'— by the "day attendance/members number" ratio,, *'3' — by the "Likes number/members number" ratio,, *'4' — by the "comments number/members number" ratio,, *'5' — by the "boards entries number/members number" ratio.
:param offset: Offset needed to return a specific subset of results.
:param count: Number of communities to return. "Note that you can not receive more than first thousand of results, regardless of 'count' and 'offset' values."
"""
params = {
k if not k.endswith("_") else k[:-1]: v
async def __call__(self, group_id: int) -> responses.groups.GetLongPollSettings:
""" groups.getLongPollSettings
From Vk Docs: Returns Long Poll notification settings
Access from user, group token(s)
:param group_id: Community ID.
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
}
return await self.request(
"groups.getLongPollSettings",
params,
response_model=responses.groups.GetLongPollSettingsModel,
)
self,
group_id: int,
address_id: int,
title: str = None,
address: str = None,
additional_address: str = None,
country_id: int = None,
city_id: int = None,
metro_id: int = None,
latitude: typing.Any = None,
longitude: typing.Any = None,
phone: str = None,
work_info_status: str = None,
timetable: str = None,
is_main_address: bool = None,
) -> responses.groups.EditAddress:
""" groups.editAddress
From Vk Docs:
Access from user, group token(s)
:param group_id:
:param address_id:
:param title:
:param address:
:param additional_address:
:param country_id:
:param city_id:
:param metro_id:
:param latitude:
:param longitude:
:param phone:
:param work_info_status:
:param timetable:
""" groups.getCallbackServers
From Vk Docs:
Access from user, group token(s)
:param group_id:
:param server_ids:
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
}
return await self.request(
"groups.getCallbackServers",
params,
response_model=responses.groups.GetCallbackServersModel,
)
async def __call__(
self,
group_id: str = None,
sort: str = None,
offset: int = None,
count: int = None,
fields: typing.List = None,
filter: str = None,
) -> responses.groups.GetMembers:
""" groups.getMembers
From Vk Docs: Returns a list of community members.
Access from user, group, service token(s)
:param group_id: ID or screen name of the community.
:param sort: Sort order. Available values: 'id_asc', 'id_desc', 'time_asc', 'time_desc'. 'time_asc' and 'time_desc' are availavle only if the method is called by the group's 'moderator'.
:param offset: Offset needed to return a specific subset of community members.
:param count: Number of community members to return.
:param fields: List of additional fields to be returned. Available values: 'sex, bdate, city, country, photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, photo_max_orig, online, online_mobile, lists, domain, has_mobile, contacts, connections, site, education, universities, schools, can_post, can_see_all_posts, can_see_audio, can_write_private_message, status, last_seen, common_count, relation, relatives, counters'.
:param filter: *'friends' – only friends in this community will be returned,, *'unsure' – only those who pressed 'I may attend' will be returned (if it's an event).
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
}
:param group_id: Group ID to return invited users for.
:param offset: Offset needed to return a specific subset of results.
:param count: Number of results to return.
:param fields: List of additional fields to be returned. Available values: 'sex, bdate, city, country, photo_50, photo_100, photo_200_orig, photo_200, photo_400_orig, photo_max, photo_max_orig, online, online_mobile, lists, domain, has_mobile, contacts, connections, site, education, universities, schools, can_post, can_see_all_posts, can_see_audio, can_write_private_message, status, last_seen, common_count, relation, relatives, counters'.
:param name_case: Case for declension of user name and surname. Possible values: *'nom' — nominative (default),, *'gen' — genitive,, *'dat' — dative,, *'acc' — accusative, , *'ins' — instrumental,, *'abl' — prepositional.
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
}
return await self.request(
"groups.getInvitedUsers",
params,
response_model=responses.groups.GetInvitedUsersModel,
)
async def __call__(
self, group_id: int, server_id: int = None
) -> responses.groups.GetCallbackSettings:
""" groups.getCallbackSettings
From Vk Docs: Returns [vk.com/dev/callback_api|Callback API] notifications settings.
Access from user, group token(s)
:param group_id: Community ID.
:param server_id: Server ID.
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
}
return await self.request(
"groups.getCallbackSettings",
params,
response_model=responses.groups.GetCallbackSettingsModel,
async def __call__(
self, group_id: int, title: str, url: str, secret_key: str = None
) -> responses.groups.AddCallbackServer:
""" groups.addCallbackServer
From Vk Docs:
Access from user, group token(s)
:param group_id:
:param url:
:param title:
:param secret_key:
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
}
return await self.request(
"groups.addCallbackServer",
) -> responses.groups.GetById:
""" groups.getById
From Vk Docs: Returns information about communities by their IDs.
Access from user, group, service token(s)
:param group_ids: IDs or screen names of communities.
:param group_id: ID or screen name of the community.
:param fields: Group fields to return.
"""
params = {
k if not k.endswith("_") else k[:-1]: v
for k, v in {**locals(), **self.kwargs}.items()
if k not in ["self"] and v is not None
}
return await self.request(
"groups.getById", params, response_model=responses.groups.GetByIdModel
)