How to use the vkbottle.types.responses.ok_response.OkResponse function in vkbottle

To help you get started, we’ve selected a few vkbottle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github timoniq / vkbottle / vkbottle / types / methods / pages.py View on Github external
    async def __call__(self, url: str) -> responses.ok_response.OkResponse:
        """ pages.clearCache
        From Vk Docs: Allows to clear the cache of particular 'external' pages which may be attached to VK posts.
        Access from user, service token(s)
        :param url: Address of the page where you need to refesh the cached version
        """

        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(
            "pages.clearCache",
            params,
            response_model=responses.ok_response.OkResponseModel,
        )
github timoniq / vkbottle / vkbottle / types / methods / photos.py View on Github external
async def __call__(
        self,
        album_id: int,
        title: str = None,
        description: str = None,
        owner_id: int = None,
        privacy_view: typing.List = None,
        privacy_comment: typing.List = None,
        upload_by_admins_only: bool = None,
        comments_disabled: bool = None,
    ) -> responses.ok_response.OkResponse:
        """ photos.editAlbum
        From Vk Docs: Edits information about a photo album.
        Access from user token(s)
        :param album_id: ID of the photo album to be edited.
        :param title: New album title.
        :param description: New album description.
        :param owner_id: ID of the user or community that owns the album.
        :param privacy_view: 
        :param privacy_comment: 
        :param upload_by_admins_only: 
        :param comments_disabled: 
        """

        params = {
            k if not k.endswith("_") else k[:-1]: v
            for k, v in {**locals(), **self.kwargs}.items()
github timoniq / vkbottle / vkbottle / types / methods / storage.py View on Github external
async def __call__(
        self, key: str, value: str = None, user_id: int = None, global_: bool = None
    ) -> responses.ok_response.OkResponse:
        """ storage.set
        From Vk Docs: Saves a value of variable with the name set by 'key' parameter.
        Access from user token(s)
        :param key: 
        :param value: 
        :param user_id: 
        :param global: 
        """

        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(
            "storage.set", params, response_model=responses.ok_response.OkResponseModel
github timoniq / vkbottle / vkbottle / types / methods / messages.py View on Github external
async def __call__(
        self, chat_id: int, title: str
    ) -> responses.ok_response.OkResponse:
        """ messages.editChat
        From Vk Docs: Edits the title of a chat.
        Access from user, group token(s)
        :param chat_id: Chat ID.
        :param title: New title of the chat.
        """

        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(
            "messages.editChat",
            params,
            response_model=responses.ok_response.OkResponseModel,
github timoniq / vkbottle / vkbottle / types / methods / apps.py View on Github external
    async def __call__(self,) -> responses.ok_response.OkResponse:
        """ apps.deleteAppRequests
        From Vk Docs: Deletes all request notifications from the current app.
        Access from user token(s)
        
        """

        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(
            "apps.deleteAppRequests",
            params,
            response_model=responses.ok_response.OkResponseModel,
        )
github timoniq / vkbottle / vkbottle / types / methods / ads.py View on Github external
async def __call__(
        self, account_id: int, target_group_id: int, client_id: int = None
    ) -> responses.ok_response.OkResponse:
        """ ads.deleteTargetGroup
        From Vk Docs: Deletes a retarget group.
        Access from user token(s)
        :param account_id: Advertising account ID.
        :param client_id: 'Only for advertising agencies.' , ID of the client with the advertising account where the group will be created.
        :param target_group_id: 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(
            "ads.deleteTargetGroup",
            params,
github timoniq / vkbottle / vkbottle / types / methods / video.py View on Github external
async def __call__(
        self, video_id: int, owner_id: int = None
    ) -> responses.ok_response.OkResponse:
        """ video.restore
        From Vk Docs: Restores a previously deleted video.
        Access from user token(s)
        :param video_id: Video ID.
        :param owner_id: ID of the user or community that owns the video.
        """

        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(
            "video.restore",
            params,
            response_model=responses.ok_response.OkResponseModel,
github timoniq / vkbottle / vkbottle / types / methods / notes.py View on Github external
async def __call__(
        self, comment_id: int, message: str, owner_id: int = None
    ) -> responses.ok_response.OkResponse:
        """ notes.editComment
        From Vk Docs: Edits a comment on a note.
        Access from user token(s)
        :param comment_id: Comment ID.
        :param owner_id: Note owner ID.
        :param message: New comment text.
        """

        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(
            "notes.editComment",
            params,
github timoniq / vkbottle / vkbottle / types / methods / polls.py View on Github external
async def __call__(
        self,
        poll_id: int,
        owner_id: int = None,
        question: str = None,
        add_answers: str = None,
        edit_answers: str = None,
        delete_answers: str = None,
        end_date: int = None,
        photo_id: int = None,
        background_id: str = None,
    ) -> responses.ok_response.OkResponse:
        """ polls.edit
        From Vk Docs: Edits created polls
        Access from user token(s)
        :param owner_id: poll owner id
        :param poll_id: edited poll's id
        :param question: new question text
        :param add_answers: answers list, for example: , "["yes","no","maybe"]"
        :param edit_answers: object containing answers that need to be edited,, key – answer id, value – new answer text. Example: {"382967099":"option1", "382967103":"option2"}"
        :param delete_answers: list of answer ids to be deleted. For example: "[382967099, 382967103]"
        :param end_date: 
        :param photo_id: 
        :param background_id: 
        """

        params = {
            k if not k.endswith("_") else k[:-1]: v
github timoniq / vkbottle / vkbottle / types / methods / stats.py View on Github external
    async def __call__(self, id: str) -> responses.ok_response.OkResponse:
        """ stats.trackVisitor
        From Vk Docs: 
        Access from user token(s)
        :param 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(
            "stats.trackVisitor",
            params,
            response_model=responses.ok_response.OkResponseModel,
        )