Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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(
"board.editTopic",
params,
response_model=responses.ok_response.OkResponseModel,
)
class BoardFixTopic(BaseMethod):
kwargs: dict = {}
access_token_type: APIAccessibility = [APIAccessibility.USER]
async def __call__(
self, group_id: int, topic_id: int
) -> responses.ok_response.OkResponse:
""" board.fixTopic
From Vk Docs: Pins a topic (fixes its place) to the top of a community's discussion board.
Access from user token(s)
:param group_id: ID of the community that owns the discussion board.
:param topic_id: Topic 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
}
:param extended: '1' — to return an extended response with additional fields. By default: '0'.
"""
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.isMember", params, response_model=responses.groups.IsMemberModel
)
class GroupsJoin(BaseMethod):
kwargs: dict = {}
access_token_type: APIAccessibility = [APIAccessibility.USER]
async def __call__(
self, group_id: int = None, not_sure: str = None
) -> responses.ok_response.OkResponse:
""" groups.join
From Vk Docs: With this method you can join the group or public page, and also confirm your participation in an event.
Access from user token(s)
:param group_id: ID or screen name of the community.
:param not_sure: Optional parameter which is taken into account when 'gid' belongs to the event: '1' — Perhaps I will attend, '0' — I will be there for sure (default), ,
"""
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
}
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(
"auth.checkPhone",
params,
response_model=responses.ok_response.OkResponseModel,
)
class AuthRestore(BaseMethod):
kwargs: dict = {}
access_token_type: APIAccessibility = [APIAccessibility.USER, APIAccessibility.OPEN]
async def __call__(self, phone: str, last_name: str) -> responses.auth.Restore:
""" auth.restore
From Vk Docs: Allows to restore account access using a code received via SMS. " This method is only available for apps with [vk.com/dev/auth_direct|Direct authorization] access. "
Access from user, open token(s)
:param phone: User phone number.
:param last_name: User last name.
"""
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(
"auth.restore", params, response_model=responses.auth.RestoreModel
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(
"streaming.getServerUrl",
params,
response_model=responses.streaming.GetServerUrlModel,
)
class StreamingSetSettings(BaseMethod):
kwargs: dict = {}
access_token_type: APIAccessibility = [
APIAccessibility.USER,
APIAccessibility.SERVICE,
]
async def __call__(
self, monthly_tier: str = None
) -> responses.ok_response.OkResponse:
""" streaming.setSettings
From Vk Docs:
Access from user, service token(s)
:param monthly_tier:
"""
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
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(
"docs.getWallUploadServer",
params,
response_model=responses.base.GetUploadServerModel,
)
class DocsSave(BaseMethod):
kwargs: dict = {}
access_token_type: APIAccessibility = [
APIAccessibility.USER,
APIAccessibility.GROUP,
]
async def __call__(
self, file: str, title: str = None, tags: str = None
) -> responses.docs.Save:
""" docs.save
From Vk Docs: Saves a document after [vk.com/dev/upload_files_2|uploading it to a server].
Access from user, group token(s)
:param file: This parameter is returned when the file is [vk.com/dev/upload_files_2|uploaded to the server].
:param title: Document title.
:param tags: Document tags.
"""
params = {
k if not k.endswith("_") else k[:-1]: v
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(
"stories.getPhotoUploadServer",
params,
response_model=responses.stories.GetPhotoUploadServerModel,
)
class StoriesGetReplies(BaseMethod):
kwargs: dict = {}
access_token_type: APIAccessibility = [
APIAccessibility.USER,
APIAccessibility.GROUP,
]
async def __call__(
self,
owner_id: int,
story_id: int,
access_key: str = None,
extended: bool = None,
fields: typing.List = None,
) -> responses.stories.GetReplies:
""" stories.getReplies
From Vk Docs: Returns replies to the story.
Access from user, group token(s)
:param owner_id: Story owner ID.
:param story_id: Story 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(
"database.getSchoolClasses",
params,
response_model=responses.database.GetSchoolClassesModel,
)
class DatabaseGetSchools(BaseMethod):
kwargs: dict = {}
access_token_type: APIAccessibility = [
APIAccessibility.USER,
APIAccessibility.SERVICE,
]
async def __call__(
self, city_id: int, q: str = None, offset: int = None, count: int = None
) -> responses.database.GetSchools:
""" database.getSchools
From Vk Docs: Returns a list of schools.
Access from user, service token(s)
:param q: Search query.
:param city_id: City ID.
:param offset: Offset needed to return a specific subset of schools.
:param count: Number of schools to return.
"""
params = {
# Generated with love
from vkbottle.types import responses
from .access import APIAccessibility
from .method import BaseMethod
class GiftsGet(BaseMethod):
kwargs: dict = {}
access_token_type: APIAccessibility = [APIAccessibility.USER]
async def __call__(
self, user_id: int = None, count: int = None, offset: int = None
) -> responses.gifts.Get:
""" gifts.get
From Vk Docs: Returns a list of user gifts.
Access from user token(s)
:param user_id: User ID.
:param count: Number of gifts to return.
:param offset: Offset needed to return a specific subset of results.
"""
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:
"""
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(
"status.get", params, response_model=responses.status.GetModel
)
class StatusSet(BaseMethod):
kwargs: dict = {}
access_token_type: APIAccessibility = [APIAccessibility.USER]
async def __call__(
self, text: str = None, group_id: int = None, audio: str = None
) -> responses.ok_response.OkResponse:
""" status.set
From Vk Docs: Sets a new status for the current user.
Access from user token(s)
:param text: Text of the new status.
:param group_id: Identifier of a community to set a status in. If left blank the status is set to current user.
:param audio: needed to make status with audio
"""
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
# Generated with love
import typing
from vkbottle.types import responses
from .access import APIAccessibility
from .method import BaseMethod
class SearchGetHints(BaseMethod):
kwargs: dict = {}
access_token_type: APIAccessibility = [APIAccessibility.USER]
async def __call__(
self,
q: str = None,
offset: int = None,
limit: int = None,
filters: typing.List = None,
fields: typing.List = None,
search_global: bool = None,
) -> responses.search.GetHints:
""" search.getHints
From Vk Docs: Allows the programmer to do a quick search for any substring.
Access from user token(s)
:param q: Search query string.
:param offset: Offset for querying specific result subset
:param limit: Maximum number of results to return.